Skip to content

Commit dabcce9

Browse files
authored
[stubtest] ignore __conditional_annotations__ (#20392)
On Python 3.14, this module attribute seems to exist in certain situations: ```pycon >>> if True: ... a: str ... >>> __conditional_annotations__ {0} ``` It's a pretty esoteric attribute without any documentation. It seems to have been added in python/cpython#130935 Either way, stubtest was complaining about it in scipy-stubs. So all things considered, I figured it'd be best to just ignore it.
1 parent 888473f commit dabcce9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mypy/stubtest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1653,6 +1653,7 @@ def verify_typealias(
16531653
"__loader__",
16541654
"__spec__",
16551655
"__annotations__",
1656+
"__conditional_annotations__", # 3.14+
16561657
"__annotate__",
16571658
"__path__", # mypy adds __path__ to packages, but C packages don't have it
16581659
"__getattr__", # resulting behaviour might be typed explicitly

0 commit comments

Comments
 (0)