stubtest raises an exception when a classmethod
's first parameter not named cls
#16583
Labels
classmethod
's first parameter not named cls
#16583
Crash Report
From python/typeshed#10544 (comment)
Where networkx's source code has:
Traceback
To Reproduce
(Write what you did to reproduce the crash. Full source code is
appreciated. We also very much appreciate it if you try to narrow the
source down to a small stand-alone example.)
From my experience, in typeshed, changing any
classmethod
's first parameter of a class that is present at runtime should raise the exception.For example, in
stubs/urllib3/urllib3/fields.pyi
, you could changeRequestField.from_tuples
'scls
parameter to anything else (ie:not_cls
). Then runpython ./tests/stubtest_third_party.py urllib3
.Your Environment
mypy.ini
(and other config files): N/AThe text was updated successfully, but these errors were encountered: