Allow assigning ellipsis literal as parameter default value (#14982)
Resolves #14840 ## Summary Usage of ellipsis literal as default argument is allowed in stub files. ## Test Plan Added mdtest for both python files and stub files. --------- Co-authored-by: Carl Meyer <carl@oddbird.net> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
committed by
GitHub
parent
2ea63620cf
commit
b26448926a
@@ -122,3 +122,10 @@ class Foo: ...
|
||||
x = Foo()
|
||||
reveal_type(x) # revealed: Foo
|
||||
```
|
||||
|
||||
## Annotated assignments in stub files are inferred correctly
|
||||
|
||||
```pyi path=main.pyi
|
||||
x: int = 1
|
||||
reveal_type(x) # revealed: Literal[1]
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user