Skip to content

Commit

Permalink
Remove note about Optional still being necessary sometimes (#9687)
Browse files Browse the repository at this point in the history
  • Loading branch information
srittau authored Feb 7, 2023
1 parent 0ef9c3f commit 565a1a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ Some further tips for good type hints:
* use built-in generics (`list`, `dict`, `tuple`, `set`), instead
of importing them from `typing`.
* use `X | Y` instead of `Union[X, Y]` and `X | None`, instead of
`Optional[X]`, **except** when it is not possible due to mypy bugs (type aliases and base classes);
`Optional[X]`;
* in Python 3 stubs, import collections (`Mapping`, `Iterable`, etc.)
from `collections.abc` instead of `typing`;
* avoid invariant collection types (`list`, `dict`) in argument
Expand Down

0 comments on commit 565a1a0

Please sign in to comment.