mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-02 09:52:18 +00:00
Use binary semantics when __iadd__
et al are unbound (#13987)
## Summary I noticed that augmented assignments on floats were yielding "not supported" diagnostics. If the dunder isn't bound at all, we should use binary operator semantics, rather than treating it as not-callable.
This commit is contained in:
parent
71536a43db
commit
262c04f297
3 changed files with 28 additions and 26 deletions
|
@ -6,6 +6,10 @@
|
|||
x = 3
|
||||
x -= 1
|
||||
reveal_type(x) # revealed: Literal[2]
|
||||
|
||||
x = 1.0
|
||||
x /= 2
|
||||
reveal_type(x) # revealed: float
|
||||
```
|
||||
|
||||
## Dunder methods
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue