Skip to content

Commit 5cbf483

Browse files
Update "mypy comparison" documentation based on recent improvements in mypy (#9502)
It now uses union over join in more situations. See https://mypy-play.net/?mypy=latest&python=3.13&gist=c8e017a31980f3c4fc6fc66ed2331da9
1 parent 96b8b84 commit 5cbf483

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

docs/mypy-comparison.md

-8
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,6 @@ def func1(val: object):
5252
else:
5353
return
5454
reveal_type(val) # mypy: object, pyright: str | int
55-
56-
def func2(condition: bool, val1: str, val2: int):
57-
x = val1 if condition else val2
58-
reveal_type(x) # mypy: object, pyright: str | int
59-
60-
y = val1 or val2
61-
# In this case, mypy uses a union instead of a join
62-
reveal_type(y) # mypy: str | int, pyright: str | int
6355
```
6456

6557

0 commit comments

Comments
 (0)