stubtest: changes for py313#17261
Conversation
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
| if strip_prefix(stub_arg.variable.name, "__") == runtime_arg.name: | ||
| return | ||
|
|
||
| nonspecific_names = {"object", "args"} |
There was a problem hiding this comment.
Why do we need this block?
There was a problem hiding this comment.
stubtest attempts to make sure that positional-only arguments have vaguely the same names. This is because when I first wrote stubtest, I found cases of mismatched pos-only args in typeshed. Now having fixed all of those, the value of this check to typeshed is lower, but I'd still like to keep it.
Python 3.13 added text signatures for more callables, but these signatures are autogenerated, see https://github.com/python/cpython/pull/107794/files#diff-1decebeef15f4e0b0ce106c665751ec55068d4d1d1825847925ad4f528b5b872R589
So now we no longer check the stub name is vaguely similar if the runtime name is "object"
Technically it feels like we should be able to put the new dunders on
typeor 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