Skip to content

AttributeError: 'TypeVar' object has no attribute 'pytype' #11053

@correctmost

Description

@correctmost

Bug description

# Code from a local fuzzing run

def f[T]():
   T.a

Configuration

Command used

pylint crash.py

Pylint output

Traceback (most recent call last):
  File "pylint/pylint/utils/ast_walker.py", line 87, in walk
    callback(astroid)
    ~~~~~~~~^^^^^^^^^
  File "pylint/pylint/checkers/typecheck.py", line 1121, in visit_attribute
    qualname = f"{owner.pytype()}.{node.attrname}"
                  ^^^^^^^^^^^^
AttributeError: 'TypeVar' object has no attribute 'pytype'

Expected behavior

No crash

Pylint version

pylint-dev/pylint@880b90d4a
pylint-dev/astroid@1f3b8fad1f
Python 3.14.5

OS / Environment

Arch Linux

Additional dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    Crash 💥A bug that makes pylint crashNeeds PRThis issue is accepted, sufficiently specified and now needs an implementation

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions