Skip to content

Commit 517f5ae

Browse files
authored
Stubtest: ignore a new protocol dunder (#16895)
This is added to all protocol classes on Python 3.12.2+ (it was added in a patch release of 3.12 as part of a bugfix). There's no reason why you'd want to explicitly include it in a stub (and doing so would lead the type checker to incorrectly conclude that you wanted a member literally called `__non_callable_proto_members__`) Cf. python/typeshed#11384 and python/typeshed#11383
1 parent 780a29d commit 517f5ae

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mypy/stubtest.py

+1
Original file line numberDiff line numberDiff line change
@@ -1486,6 +1486,7 @@ def verify_typealias(
14861486
# Added to all protocol classes on 3.12+ (or if using typing_extensions.Protocol)
14871487
"__protocol_attrs__",
14881488
"__callable_proto_members_only__",
1489+
"__non_callable_proto_members__",
14891490
# typing implementation details, consider removing some of these:
14901491
"__parameters__",
14911492
"__origin__",

0 commit comments

Comments
 (0)