Alex Waygood

Results 901 comments of Alex Waygood

Unfortunately flake8 complains with this suggested change: ``` stdlib/typing.pyi:164:28: Y011 Only simple default values allowed for typed arguments stdlib/typing.pyi:164:28: F821 undefined name 'NoDefault' stdlib/typing.pyi:234:61: Y011 Only simple default values allowed...

> 3\. Another rule would be to automatically order `__all__` This already exists as `unsorted-dunder-all` in our `ruff` category!

Hi! Would you be able to do this using the `args` key in your `.pre-commit-config.yaml` file? E.g. something like ```yaml - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.5.7 hooks: - id: ruff name:...

Ahh I see, thanks for explaining

I figured out a hacky workaround for this in https://github.com/python/mypy/pull/11909. Instead of having `assert sys.platform == "win32"` at the top of the function, instead do this: ```python if sys.platform !=...

I think mypy should indeed emit an error on your code snippet, but not the error you think. Your use of `ParamSpec` here is invalid -- the `ParamSpec` `P` in...

> @AlexWaygood It is true that the `ParamSpec` is only used once, but there is still an issue that the `P` could represent any signature. Look at this [playground](https://mypy-play.net/?mypy=master&python=3.11&flags=show-error-context%2Cshow-column-numbers%2Cshow-error-codes%2Cstrict%2Ccheck-untyped-defs%2Cdisallow-any-decorated%2Cdisallow-any-expr%2Cdisallow-any-explicit%2Cdisallow-any-generics%2Cdisallow-any-unimported%2Cdisallow-incomplete-defs%2Cdisallow-subclassing-any%2Cdisallow-untyped-calls%2Cdisallow-untyped-decorators%2Cdisallow-untyped-defs%2Cno-implicit-optional%2Cno-implicit-reexport%2Cno-strict-optional%2Cstrict-equality%2Cwarn-incomplete-stub%2Cwarn-redundant-casts%2Cwarn-return-any%2Cwarn-unreachable%2Cwarn-unused-configs%2Cwarn-unused-ignores&gist=925e84f802413a564c50857d35e1f525) Yes,...

Unfortunately I'm only a triager here so do not have power to merge. I could review, but I also have pretty limited time to work on mypy right now, sadly....

I'm struggling to reproduce this on mypy-playground or locally. Do you have any configuration files lying around, e.g. `pyproject.toml` or `mypy.ini`?

Thanks — this is a duplicate of #17646. Internally `Self` is just implemented as a special kind of TypeVar, and with mypy's new `functools.partial` plugin it's no longer respecting the...