Skip to content

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

Description

@kevinleahy-switchdin

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]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    PyrightIssues that depend on Pyright/Pylance doing something.TypingTyping/stub/Mypy/PyRight related bugs.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions