diff options
| author | Martin Fischer <martin@push-f.com> | 2022-02-28 16:12:22 +0100 | 
|---|---|---|
| committer | Martin Fischer <martin@push-f.com> | 2022-02-28 16:12:22 +0100 | 
| commit | a080a080f61d945712f17f68882b3b3b5781e1c8 (patch) | |
| tree | 5f2337db8e6d9cc0ccc89f096e888ceb0414b8c5 /puzzles | |
| parent | f752a8559959733f2224e92c8a86b512278371f9 (diff) | |
add puzzles/infer_literal_narrowing.py
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 | 
