File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,12 +44,19 @@ Motivation
4444 value: T | None = None
4545
4646 # The type argument isn't specified.
47- reveal_type(Box()) # type is Box[int]
47+ reveal_type(Box()) # type is Box[int]
48+
49+ # The type argument is specified with '[]'.
50+ reveal_type(Box[str]()) # type is Box[str]
4851
4952 # The type argument is specified with
50- # the type inference by an assigned value
53+ # the type inference by an assigned value.
5154 reveal_type(Box(value="Hello World!")) # type is Box[str]
5255
56+ # The type argument is specified with '[]' but not with the type
57+ # inference by an assigned value because '[]' is prioritized.
58+ reveal_type(Box[str](value="Hello World!")) # type is Box[str]
59+
5360One place this `regularly comes
5461up <https://github.com/python/typing/issues/975> `__ is ``Generator ``. I
5562propose changing the *stub definition * to something like::
You can’t perform that action at this time.
0 commit comments