Skip to content

Commit 1c83463

Browse files
authored
stubtest: changes for py313 (#17261)
Technically it feels like we should be able to put the new dunders on `type` or something, but that wasn't enough to make false positives go away. But also we might not want to do that because it only applies to pure Python types
1 parent 828c0be commit 1c83463

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

mypy/stubtest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,10 @@ def strip_prefix(s: str, prefix: str) -> str:
634634
if strip_prefix(stub_arg.variable.name, "__") == runtime_arg.name:
635635
return
636636

637+
nonspecific_names = {"object", "args"}
638+
if runtime_arg.name in nonspecific_names:
639+
return
640+
637641
def names_approx_match(a: str, b: str) -> bool:
638642
a = a.strip("_")
639643
b = b.strip("_")
@@ -1455,6 +1459,8 @@ def verify_typealias(
14551459
"__getattr__", # resulting behaviour might be typed explicitly
14561460
"__setattr__", # defining this on a class can cause worse type checking
14571461
"__vectorcalloffset__", # undocumented implementation detail of the vectorcall protocol
1462+
"__firstlineno__",
1463+
"__static_attributes__",
14581464
# isinstance/issubclass hooks that type-checkers don't usually care about
14591465
"__instancecheck__",
14601466
"__subclasshook__",

0 commit comments

Comments
 (0)