-
Notifications
You must be signed in to change notification settings - Fork 219
Open
Labels
attribute accessInstance attributes, class attributes, etc.Instance attributes, class attributes, etc.control flow
Milestone
Description
In astral-sh/ruff#20128, we disabled boundness analysis for implicit instance attributes:
class C:
def __init__(self):
if False:
self.x = 1
C().x # would previously show an error, with this PR we pretend the attribute existsIt is possible that we can simply re-enable this now that we have a better strategy for dealing with these cyclic type inference problems.
We probably don't want a full-blown revert of that PR. I like TypeQualifiers::IMPLICIT_INSTANCE_ATTRIBUTE much better than TypeQualifiers::POSSIBLY_UNBOUND_IMPLICIT_ATTRIBUTE, so maybe we can prevent bringing the latter back.
For some reason, I don't see any regression tests for #758 in that PR, so we should probably add them when we resolve this issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
attribute accessInstance attributes, class attributes, etc.Instance attributes, class attributes, etc.control flow