More docs improvements.

This commit is contained in:
Eric Traut 2020-08-02 14:50:14 -07:00
parent c7dfba390d
commit 997fd7d57c

View File

@ -57,10 +57,10 @@ In this example, the type evaluator knows that parameter a is either None, str,
Narrowing is also applied values are assigned to a variable.
```python
def func():
def func(b: Optional[Union[str, List[str]]]):
# The declared type of “a” is a union of three types
# (str, List[str] and None).
a: Optional[Union[str, List[str]]]
a: Optional[Union[str, List[str]]] = b
reveal_type(a) # Type is `Optional[Union[str, List[str]]]`
a = "hi"