Update body.md with Python 3.10 union type example

This commit is contained in:
Cedric L'homme 2024-04-07 18:12:23 -04:00 committed by GitHub
parent 3425c834cc
commit b0759c463f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -206,7 +206,7 @@ The function parameters will be recognized as follows:
!!! note
FastAPI will know that the value of `q` is not required because of the default value `= None`.
The `Union` in `Union[str, None]` is not used by FastAPI, but will allow your editor to give you better support and detect errors.
The `Union` in `Union[str, None]` (Python 3.8+), or `str | None` (Python 3.10+), is not used by FastAPI, but will allow your editor to give you better support and detect errors.
## Without Pydantic