diff options
Diffstat (limited to 'puzzles')
-rw-r--r-- | puzzles/infer_literal_narrowing.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/puzzles/infer_literal_narrowing.py b/puzzles/infer_literal_narrowing.py new file mode 100644 index 0000000..953405a --- /dev/null +++ b/puzzles/infer_literal_narrowing.py @@ -0,0 +1,5 @@ +from typing import Literal + +def f(x: int) -> None: + if x == 1 or x == 2: + _: Literal[1, 2] = x |