Closed benglewis closed 2 days ago
This code is clever, but it's unfortunately too dynamic and complex for a static type checker to handle. I don't see a good way to make this work in pyright. Other type checkers like mypy generate the same errors in this case.
If you want to use this technique along with static type checking, you'll need to find workarounds or suppress the type errors you're seeing.
Note: if you are reporting a wrong signature of a function or a class in the standard library, then the typeshed tracker is better suited for this report: https://github.com/python/typeshed/issues.
If you have a question about typing or a behavior that you’re seeing in Pyright (as opposed to a bug report or enhancement request), consider posting to the Pyright discussion forum.
Describe the bug
Using
classmethod
as a function on apartial
does not seem to work properly, and returns two type errors:Code or Screenshots
VS Code extension or command-line Are you running pyright as a VS Code extension, a language server in another editor, integrated into Pylance, or the command-line tool? Which version?
VSCode with Pylance: VSCode version 1.93.1 Pylance version v2024.9.2