Skip to content

self.__attrs_init__ doesn't play well with pylance/pyright #1360

Open
@kevinleahy-switchdin

Description

Python version: 3.12.5
attrs version: 23.2.0
pylance version: v2024.10.1

code:

import attrs


@attrs.define
class MyClass:
    x: int

    def __init__(self, x: int):
        self.__attrs_init__(x)
#              ^^^^^^^^^^
#  Cannot access attribute "__attrs_init__" for class "MyClass*"
#  Attribute "__attrs_init__" is unknown Pylance[reportAttributeAccessIssue]

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions