Skip to content

Commit 03e7be2

Browse files
committed
Update tutorial003.md annotations for Python 3.10+
1 parent 695d448 commit 03e7be2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs_src/tutorial/create_db_and_table/annotations/en/tutorial003.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
4. Create the `id` field:
88

9-
It could be `None` until the database assigns a value to it, so we annotate it with `Optional`.
9+
It could be `None` until the database assigns a value to it, so we annotate it with `Optional` (`int | None` in Python 3.10+).
1010

1111
It is a **primary key**, so we use `Field()` and the argument `primary_key=True`.
1212

@@ -24,7 +24,7 @@
2424

2525
In the database, the default value will be `NULL`, the SQL equivalent of `None`.
2626

27-
As this field could be `None` (and `NULL` in the database), we annotate it with `Optional`.
27+
As this field could be `None` (and `NULL` in the database), we annotate it with `Optional` (`int | None` in Python 3.10+).
2828

2929
8. Write the name of the database file.
3030
9. Use the name of the database file to create the database URL.

0 commit comments

Comments
 (0)