From de0ac640e91fe0f200a244ddff95ab3e040fddae Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Tue, 7 Feb 2023 11:51:12 +0100 Subject: [PATCH] Remove note about Optional still being necessary sometimes --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cef22cb67aba..ba5c05253752 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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