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

Pylint does not conform to PEP 585 [generics parametrisation] #3320

Closed
Starwort opened this issue Dec 24, 2019 · 1 comment · Fixed by #4059
Closed

Pylint does not conform to PEP 585 [generics parametrisation] #3320

Starwort opened this issue Dec 24, 2019 · 1 comment · Fixed by #4059
Labels
Enhancement ✨ Improvement to a component

Comments

@Starwort
Copy link

Starwort commented Dec 24, 2019

Steps to reproduce

  1. Use following code:
from __future__ import annotations

def find(haystack: dict[str, list[int]]) -> int:
    ...
  1. Run pylint

Current behaviour

pylint bug.py:4:19: E1136: Value 'dict' is unsubscriptable (unsubscriptable-object)
pylint bug.py:4:29: E1136: Value 'list' is unsubscriptable (unsubscriptable-object)

Expected behaviour

The errors are not thrown as that is the direct example of PEP 585, which is about parametrising standard types; ergo the syntax is valid because of the annotations __future__ import.

pylint --version output

pylint 2.4.4
astroid 2.3.3
Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)]

[ reissue of #3236 due to supporting PEP ]
Edited for formatting

@AWhetter AWhetter added the Enhancement ✨ Improvement to a component label Dec 31, 2019
@Starwort
Copy link
Author

Update: PEP 585 has been accepted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement ✨ Improvement to a component
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants