We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e5af88 commit 1a7e9dfCopy full SHA for 1a7e9df
crates/red_knot_python_semantic/resources/mdtest/binary/instances.md
@@ -262,6 +262,16 @@ class B:
262
reveal_type(B() + B()) # revealed: Unknown | int
263
```
264
265
+Note that we union with `Unknown` here because `__add__` is not declared. We do infer just `int` if
266
+the callable is declared:
267
+
268
+```py
269
+class B2:
270
+ __add__: A = A()
271
272
+reveal_type(B2() + B2()) # revealed: int
273
+```
274
275
## Integration test: numbers from typeshed
276
277
We get less precise results from binary operations on float/complex literals due to the special case
0 commit comments