-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
trackingA "meta" issue that tracks completion of a bigger task via a list of smaller scoped issues.A "meta" issue that tracks completion of a bigger task via a list of smaller scoped issues.tyMulti-file analysis & type inferenceMulti-file analysis & type inference
Milestone
Description
- Write test suite with desired behavior (resolved by [red-knot] Initial tests for instance attributes #15474 and [red-knot] Initial tests for instance attributes #15474)
- Support pure instance variables, declared in class body (resolved by [red-knot] Pure instance variables declared in class body #15515)
- Add support for
typing.ClassVar(resolved by [red-knot] Add support fortyping.ClassVar#15550) - Raise diagnostics for invalid assignments to attributes (see [red-knot] Out-of-body (re-)definitions of class variables #15456; resolved by [red-knot] Invalid assignments to attributes #15613, [red-knot] Add test for nested attribute access #15684 and [red-knot] Improved error message for attribute-assignments #15668)
- Infer
Unknown | T_inferredfor undeclared class variables (resolved by [red-knot] UseUnknown | T_inferredfor undeclared public symbols #15674) - Support implicit instance attributes, which are not defined in the class body, only in
__init__or another method (resolved by [red-knot] Implicit instance attributes #15811) - Support for possibly-unbound instance attributes (resolved by [red-knot] Handle possibly-unbound instance members #16363)
- [red-knot] Support unpacking attribute assignments:
self.x, self.y = …#15962 - [red-knot] Diagnostic for class-object access to pure instance variables #15963
- [red-knot] Attributes implicitly declared via their parameter types #15960
- Support implicit class attributes (only defined in a
@classmethod) ty#205 - Attribute assignments in
@staticmethods should not influence instance attributes ty#207 - Handle cycles in type inference once we understand the type of
self - [red-knot] Descriptor protocol #15966
- Diagnostic for conflicting declared attribute types ty#206
- [red-knot] Detect unreachable attributes assignments #15967
- Implement method call checking (resolved by [red-knot] Method calls and the descriptor protocol #16121)
- Bare
ClassVarannotations ty#211
See also: Markdown test suite with some open TODOs: https://github.com/astral-sh/ruff/blob/main/crates/red_knot_python_semantic/resources/mdtest/attributes.md
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
trackingA "meta" issue that tracks completion of a bigger task via a list of smaller scoped issues.A "meta" issue that tracks completion of a bigger task via a list of smaller scoped issues.tyMulti-file analysis & type inferenceMulti-file analysis & type inference