Skip to content

Naming requirements for annotated types depend on Python version (pylint 4 regression) #10696

@torotil

Description

@torotil

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.13

Configuration

Command used

pylint annotated.py

Pylint 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

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions