From: MendyLanda <54242706+MendyLanda@users.noreply.github.com> Date: Sun, 4 Sep 2022 13:29:06 +0000 (-0400) Subject: 📝 Add note about Python 3.10 `X | Y` operator in explanation about Response Models... X-Git-Tag: 0.82.0~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ae369d879af021fa3477a39155981f346578a078;p=thirdparty%2Ffastapi%2Ffastapi.git 📝 Add note about Python 3.10 `X | Y` operator in explanation about Response Models (#5307) --- diff --git a/docs/en/docs/tutorial/response-model.md b/docs/en/docs/tutorial/response-model.md index 2bbd4d4fd5..ab68314e85 100644 --- a/docs/en/docs/tutorial/response-model.md +++ b/docs/en/docs/tutorial/response-model.md @@ -168,7 +168,7 @@ Your response model could have default values, like: {!> ../../../docs_src/response_model/tutorial004_py310.py!} ``` -* `description: Union[str, None] = None` has a default of `None`. +* `description: Union[str, None] = None` (or `str | None = None` in Python 3.10) has a default of `None`. * `tax: float = 10.5` has a default of `10.5`. * `tags: List[str] = []` as a default of an empty list: `[]`.