Skip to content

Support implicit class attributes (only defined in a @classmethod) #205

@sharkdp

Description

@sharkdp

Similar to how we support implicit instance attributes, we should also support implicitly defined class attributes. More concretely, we want the TODO comment here to be resolved, i.e. there should be no unresolved-attribute diagnostic:

https://github.com/astral-sh/ruff/blob/eb08345fd5434ed3db243233df6dd91757a6af3b/crates/red_knot_python_semantic/resources/mdtest/attributes.md?plain=1#L503-L514

The implementation for this can probably re-use most of the machinery introduced in this PR. In particular, the Type::implicit_instance_attribute method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    attribute accessInstance attributes, class attributes, etc.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions