Skip to content
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

ParseError (no attribute 'id') for bindings generated by pybind11-stubgen #1556

Closed
wojdyr opened this issue Dec 28, 2023 · 0 comments
Closed
Assignees
Labels
bug cat: stubs and 3p type stubs and third-party types

Comments

@wojdyr
Copy link

wojdyr commented Dec 28, 2023

I got stubs for C++ extension with such an annotation for the array size:

    @property
    def size(self) -> typing.Annotated[list[int], pybind11_stubgen.typing_ext.FixedSize(3)]:
        ...

which pytype doesn't like:

      def size(self) -> typing.Annotated[list[int], pybind11_stubgen.typing_ext.FixedSize(3)]:
                                                   ^
  ParseError: 'Attribute' object has no attribute 'id'

I'm new to the type annotation syntax, so just in case I wrote about it both in pybind11-stubgen and here.
Mypy and Pyright don't show any error or warning for that line.

@rchen152 rchen152 added bug cat: stubs and 3p type stubs and third-party types labels Jan 3, 2024
@rchen152 rchen152 self-assigned this Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cat: stubs and 3p type stubs and third-party types
Projects
None yet
Development

No branches or pull requests

2 participants