pylint-dev/pylint

invalid-name check for TypeVar should allow for digits in names

Closed

#8,499 opened on Mar 27, 2023

 (1 comment) (0 reactions) (0 assignees)Python (1,059 forks)batch import
C: invalid-nameFalse Positive 🦟Good first issueHacktoberfestHelp wanted 🙏Needs PR

Repository metrics

Stars
 (4,978 stars)
PR merge metrics
 (Avg merge 12h 9m) (29 merged PRs in 30d)

Description

Bug description

"""Ec2T example."""

from typing import TypeVar

T = TypeVar('T')
EcTwoT = TypeVar('EcTwoT')
Ec2T = TypeVar('Ec2T')

Configuration

No response

Command used

pylint typevar.py

Pylint output

************* Module typevar
typevar.py:7:0: C0103: Type variable name "Ec2T" doesn't conform to predefined naming style (invalid-name)

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

Expected behavior

Ec2T should be valid.

Pylint version

pylint 2.17.0
astroid 2.15.0
Python 3.11.2 (main, Mar 20 2023, 21:17:15) [Clang 14.0.0 (clang-1400.0.29.202)]

OS / Environment

MacOS 13.2.1

Additional dependencies

No response

Contributor guide