-
Notifications
You must be signed in to change notification settings - Fork 135
Closed
Labels
attribute accessInstance attributes, class attributes, etc.Instance attributes, class attributes, etc.bugSomething isn't workingSomething isn't workingruntime semanticsAccurate modeling of how Python's semantics work at runtimeAccurate modeling of how Python's semantics work at runtime
Milestone
Description
The goal of this issue is to get rid of the TODO comments in this test. An attribute assignment in a @staticmethod should not influence the existence of implicit (instance) attributes:
class Unrelated:
x: int
class C:
@staticmethod
def f(unrelated: Unrelated):
unrelated.x = 1
reveal_type(C().x) # should be an errorWhether or not this requires special-casing of @staticmethod during semantic index building is an open question. The answer to this question influences whether or not we can also handle the more exotic edge-cases in the mentioned test (e.g. aliased @staticmethod).
Part of: astral-sh/ruff#14164
Metadata
Metadata
Assignees
Labels
attribute accessInstance attributes, class attributes, etc.Instance attributes, class attributes, etc.bugSomething isn't workingSomething isn't workingruntime semanticsAccurate modeling of how Python's semantics work at runtimeAccurate modeling of how Python's semantics work at runtime