Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Y019 sensitive to PEP 570 syntax #455

Closed
hauntsaninja opened this issue Jan 4, 2024 · 0 comments · Fixed by #456
Closed

Y019 sensitive to PEP 570 syntax #455

hauntsaninja opened this issue Jan 4, 2024 · 0 comments · Fixed by #456
Labels

Comments

@hauntsaninja
Copy link
Collaborator

λ cat hm.pyi
from typing import Generic, TypeVar

_KT = TypeVar("_KT")  # Key type.
_VT = TypeVar("_VT")  # Value type.

class M1(Generic[_KT, _VT]):
    def pop(self, __key: _KT, default: _VT) -> _VT: ...


class M2(Generic[_KT, _VT]):
    def pop(self, key: _KT, /, default: _VT) -> _VT: ...

λ flake8 hm.pyi
hm.pyi:11:32: Y019 Use "_typeshed.Self" instead of "_VT", e.g. "def pop(self, key: _KT, /, default: Self) -> Self: ..."

Looks like logic for determining first parameter isn't correct

hauntsaninja added a commit to hauntsaninja/flake8-pyi that referenced this issue Jan 4, 2024
AlexWaygood pushed a commit that referenced this issue Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant