ruff
90fd7dd8 - [ty] Respect property deleters in attribute deletion checks (#24500)

Commit
120 days ago
[ty] Respect property deleters in attribute deletion checks (#24500) ## Summary This PR adds support for deleter properties, so we now error on the following: ```python class ReadOnlyProperty: @property def x(self) -> int: return 1 read_only = ReadOnlyProperty() # error: [invalid-assignment] "Cannot delete read-only property `x` on object of type `ReadOnlyProperty`" del read_only.x ``` While this looks like a lot of code, it ends up being a fairly mechanical change -- almost every line corresponds to a similar line for setters and/or getters, with the exception of `validate_attribute_deletion`.
Author
Parents
Loading