-
-
Couldn't load subscription status.
- Fork 1.2k
Closed
Labels
C: invalid-nameFalse Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the code
Milestone
Description
Bug description
pylint requires different naming conventions for annotated types (typing.Annotated) depending on the Python version used:
- under 3.11 it requires PascalCase
- under 3.13 it requires snake_case
I’m using a simple example file (annotated.py) to reproduce this:
"""Test-case for annotations."""
from typing import Annotated
int_with_annotation = Annotated[int, "anything"] # Error in Python 3.11
IntWithAnnotation = Annotated[int, "anything"] # Error in Python 3.13Configuration
Command used
pylint annotated.pyPylint output
Python 3.11
************* Module annotated
annotated.py:5:0: C0103: Class name "int_with_annotation" doesn't conform to PascalCase naming style (invalid-name)
Python 3.13
************* Module annotated
annotated.py:5:0: C0103: Variable name "IntWithAnnotation" doesn't conform to snake_case naming style (invalid-name)
Expected behavior
I would expect pylint to have the same opinion on naming conventions regardless of the (supported) Python version in use.
Pylint version
pylint 4.0.2
astroid 4.0.1
Python 3.11.13 (main, Jul 17 2025, 10:22:15) [Clang 20.1.7 ]
---
pylint 4.0.2
astroid 4.0.1
Python 3.13.5 (main, Jul 17 2025, 10:33:11) [Clang 20.1.7 ]
OS / Environment
No response
Additional dependencies
Metadata
Metadata
Assignees
Labels
C: invalid-nameFalse Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the code