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

Doesn't like TypeVar now in 2.13.3 - C0103: Type variable name.... #6050

Closed
stevie-b-g opened this issue Mar 30, 2022 · 1 comment
Closed
Labels
C: invalid-name Duplicate 🐫 Duplicate of an already existing issue

Comments

@stevie-b-g
Copy link

Bug description

pylint 2.13.3 is now compliant about C0103: Type variable name when using TypeVar

https://www.pythonsheets.com/notes/python-typing.html#using-typevar-and-generic-as-class-template

Configuration

from typing import TypeVar

CacheType = TypeVar("CacheType")

Command used

─○ cat a.py

   1   │ from typing import TypeVar
   2   │
   3   │ CacheType = TypeVar("CacheType")

╰─○ pylint a.py

--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)

╰─○ pylint --version
pylint 2.12.2
astroid 2.9.3
Python 3.9.6 (default, Aug 31 2021, 14:55:02)
[Clang 12.0.5 (clang-1205.0.22.11)]
╰─○ pip install --upgrade pylint
...
...
╰─○ pylint --version
pylint 2.13.3
astroid 2.11.2
Python 3.9.6 (default, Aug 31 2021, 14:55:02)
[Clang 12.0.5 (clang-1205.0.22.11)]
╰─○ pylint a.py
************* Module a
a.py:3:0: C0103: Type variable name "CacheType" doesn't conform to predefined naming style (invalid-name)

-------------------------------------------------------------------
Your code has been rated at 5.00/10 (previous run: 10.00/10, -5.00)

╰─○ m

Pylint output

a.py:3:0: C0103: Type variable name "CacheType" doesn't conform to predefined naming style

Expected behavior

Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)

Pylint version

pylint 2.13.3
astroid 2.11.2
Python 3.9.6 (default, Aug 31 2021, 14:55:02)

OS / Environment

No response

Additional dependencies

No response

@stevie-b-g stevie-b-g added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Mar 30, 2022
@jacobtylerwalls
Copy link
Member

Thanks for reporting. FYI this was an intentional change, see discussion at #6003.

@jacobtylerwalls jacobtylerwalls added Duplicate 🐫 Duplicate of an already existing issue C: invalid-name and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: invalid-name Duplicate 🐫 Duplicate of an already existing issue
Projects
None yet
Development

No branches or pull requests

2 participants