| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Fixing the stubtest issue... |
Sorry, something went wrong.
|
stubtest PR here: python/mypy#16750 |
Sorry, something went wrong.
Looks reasonable, though I wonder if it handles classmethods? You could probably special-case parameters named cls (and maybe even mcls, for metaclass classmethods?) in the same way you special-case parameters named self, right? |
Sorry, something went wrong.
|
Ah did I not push that change? Oops, looks like I did not. Good point on metaclasses, will do that as well |
Sorry, something went wrong.
|
Looks like there's only one instance of the old syntax that PyCQA/flake8-pyi#461 detects in the stdlib and this PR doesn't fix: Lines 204 to 205 in 1de5830 You could fix that as well by also special-casing parameters named metacls in the script (or just fix it manually with an additional commit). Maybe it'd be best to revert the handful of changes stubtest has issues with for now? We can easily defer them until there's a mypy release with the stubtest fix |
Sorry, something went wrong.
|
Thanks for checking that! I also found several cases of incorrect positional-only arguments that this PR leaves alone. It's basically all overloads containing positional-only args. Since this isn't user facing, I'd rather either just wait or use a pre-release mypy for stubtest CI |
Sorry, something went wrong.
|
Diff from mypy_primer, showing the effect of this PR on open source code: prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/utilities/pydantic.py:184: note: def __new__(cls: type[type], object, /) -> type
+ src/prefect/utilities/pydantic.py:184: note: def __new__(type[type], object, /) -> type
- src/prefect/utilities/pydantic.py:184: note: def [_typeshed.Self] __new__(cls: type[_typeshed.Self], str, tuple[type, ...], dict[str, Any], /, **kwds: Any) -> _typeshed.Self
+ src/prefect/utilities/pydantic.py:184: note: def [_typeshed.Self] __new__(type[_typeshed.Self], str, tuple[type, ...], dict[str, Any], /, **kwds: Any) -> _typeshed.Self
- src/prefect/utilities/pydantic.py:186: note: def __new__(cls: type[type], object, /) -> type
+ src/prefect/utilities/pydantic.py:186: note: def __new__(type[type], object, /) -> type
- src/prefect/utilities/pydantic.py:186: note: def [_typeshed.Self] __new__(cls: type[_typeshed.Self], str, tuple[type, ...], dict[str, Any], /, **kwds: Any) -> _typeshed.Self
+ src/prefect/utilities/pydantic.py:186: note: def [_typeshed.Self] __new__(type[_typeshed.Self], str, tuple[type, ...], dict[str, Any], /, **kwds: Any) -> _typeshed.Self
|
Sorry, something went wrong.
There was a problem hiding this comment.
Looked at a couple of files, looks great.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes #11237
This is the script I used: https://raw.githubusercontent.com/hauntsaninja/snippets/main/pep570.py
I haven't looked through the entire diff, let's see stubtest