Skip to content

Commit

Permalink
Update "mypy comparison" documentation based on recent improvements i…
Browse files Browse the repository at this point in the history
…n mypy (#9502)

It now uses union over join in more situations. See https://mypy-play.net/?mypy=latest&python=3.13&gist=c8e017a31980f3c4fc6fc66ed2331da9
  • Loading branch information
kveretennicov authored Nov 24, 2024
1 parent 96b8b84 commit 5cbf483
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions docs/mypy-comparison.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,6 @@ def func1(val: object):
else:
return
reveal_type(val) # mypy: object, pyright: str | int

def func2(condition: bool, val1: str, val2: int):
x = val1 if condition else val2
reveal_type(x) # mypy: object, pyright: str | int

y = val1 or val2
# In this case, mypy uses a union instead of a join
reveal_type(y) # mypy: str | int, pyright: str | int
```


Expand Down

0 comments on commit 5cbf483

Please sign in to comment.