-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error: Name "buffer" is not defined #87
Comments
Hi! Thanks for the report. I don't think that the solution you propose would work for everyone. And probably there would be none until python provides a counterpart to buffer protocol. The alternatives I'm thinking of are not great either, so I'm unsure how to proceed. By the way, are there other similar protocols/structures not exposed to the python interpreter? There should be just a handful of them. |
PEP 688 – Making the buffer protocol accessible in Python: https://peps.python.org/pep-0688/ |
In the meantime, PEP 688 was accepted. I've added the renaming Here are the relevant parts of tests and implementation. pybind11-stubgen/tests/stubs/demo/_bindings/typing.pyi Lines 5 to 9 in a1cd5fa
pybind11-stubgen/pybind11_stubgen/parser/mixins/fix.py Lines 309 to 330 in a1cd5fa
|
Similar to issue #86 but when using
pybind11::buffer
.This time the solution is not as simple as adding a
class buffer
, because apybind11::buffer
represents any class that satisfies the buffer protocol, and there doesn't seem to be a generic class in typing for that (see python/typing#593).Not sure what the solution should be. For now I have manually added
buffer = typing.Any
just to silence errors.The text was updated successfully, but these errors were encountered: