Skip to content

Commit e4eebb0

Browse files
author
dsku
committed
Update define relationships attributes docs: Optional[Team] -> Team | None
1 parent 91a7188 commit e4eebb0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/tutorial/relationship-attributes/define-relationships-attributes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ if hero.team:
220220

221221
## Optional Relationship Attributes
222222

223-
Notice that in the `Hero` class, the type annotation for `team` is `Optional[Team]`.
223+
Notice that in the `Hero` class, the type annotation for `team` is `Team | None` (which is equivalent to `Optional[Team]` in both Python 3.7+ and 3.9+).
224224

225225
This means that this attribute could be `None`, or it could be a full `Team` object.
226226

0 commit comments

Comments
 (0)