From 66b48cbe97bf9c7660525766afe6d7089a984769 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Fri, 24 May 2024 23:02:45 -0700 Subject: [PATCH] Fix stubgen for Python 3.13 (#17290) __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. --- mypy/stubgenc.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mypy/stubgenc.py b/mypy/stubgenc.py index 29b2636d39cc..7e3ef49c6e9a 100755 --- a/mypy/stubgenc.py +++ b/mypy/stubgenc.py @@ -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