Skip to content

Commit

Permalink
Fix stubgen for Python 3.13 (#17290)
Browse files Browse the repository at this point in the history
__firstlineno__ and __static_attributes__ are new in 3.13.
__annotate__ will be new in 3.14, so we might as well add it now.

I tried to run the test suite on 3.13. There are a ton of compilation
failures from mypyc, and a number of stubgen failures that this PR will
fix.
  • Loading branch information
JelleZijlstra committed May 25, 2024
1 parent 3ddc009 commit 66b48cb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mypy/stubgenc.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,9 @@ def is_skipped_attribute(self, attr: str) -> bool:
"__module__",
"__weakref__",
"__annotations__",
"__firstlineno__",
"__static_attributes__",
"__annotate__",
)
or attr in self.IGNORED_DUNDERS
or is_pybind_skipped_attribute(attr) # For pickling
Expand Down

0 comments on commit 66b48cb

Please sign in to comment.