Add source examples for Python 3.10 and 3.9 with updated syntax (#842)

Co-authored-by: Esteban Maya Cadavid <emayacadavid9@gmail.com>
This commit is contained in:
Sebastián Ramírez
2024-03-21 17:49:38 -05:00
committed by GitHub
parent 4c3f242ae2
commit 9141c8a920
39 changed files with 7456 additions and 25 deletions

View File

@@ -22,6 +22,36 @@ By default, we will return the first results from the database, so `offset` will
And by default, we will return a maximum of `100` heroes, so `limit` will have a default value of `100`.
//// tab | Python 3.10+
```Python hl_lines="1 7 9"
{!./docs_src/tutorial/fastapi/limit_and_offset/tutorial001_py310.py[ln:1-2]!}
# Code here omitted 👈
{!./docs_src/tutorial/fastapi/limit_and_offset/tutorial001_py310.py[ln:52-56]!}
# Code below omitted 👇
```
////
//// tab | Python 3.9+
```Python hl_lines="3 9 11"
{!./docs_src/tutorial/fastapi/limit_and_offset/tutorial001_py39.py[ln:1-4]!}
# Code here omitted 👈
{!./docs_src/tutorial/fastapi/limit_and_offset/tutorial001_py39.py[ln:54-58]!}
# Code below omitted 👇
```
////
//// tab | Python 3.7+
```Python hl_lines="3 9 11"
{!./docs_src/tutorial/fastapi/limit_and_offset/tutorial001.py[ln:1-4]!}
@@ -32,12 +62,34 @@ And by default, we will return a maximum of `100` heroes, so `limit` will have a
# Code below omitted 👇
```
////
/// details | 👀 Full file preview
//// tab | Python 3.10+
```Python
{!./docs_src/tutorial/fastapi/limit_and_offset/tutorial001_py310.py!}
```
////
//// tab | Python 3.9+
```Python
{!./docs_src/tutorial/fastapi/limit_and_offset/tutorial001_py39.py!}
```
////
//// tab | Python 3.7+
```Python
{!./docs_src/tutorial/fastapi/limit_and_offset/tutorial001.py!}
```
////
///
We want to allow clients to set different `offset` and `limit` values.