You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
classUnrelated:
x: intclassC:
@staticmethoddeff(unrelated: Unrelated):
unrelated.x=1reveal_type(C().x) # should be an error
Whether 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).
sharkdp
changed the title
Make sure that attribute assignments in @staticmethods are not considered to be instance attributes
[red-knot] Attribute assignments in @staticmethods should not influence instance attributes
Feb 5, 2025
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:Whether 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: #14164
The text was updated successfully, but these errors were encountered: