From e4eebb0cc62ef8167f9c5e47d4f57ac734c39962 Mon Sep 17 00:00:00 2001 From: dsku Date: Tue, 13 Aug 2024 22:59:31 +0800 Subject: [PATCH] Update define relationships attributes docs: `Optional[Team]` -> `Team | None` --- .../relationship-attributes/define-relationships-attributes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorial/relationship-attributes/define-relationships-attributes.md b/docs/tutorial/relationship-attributes/define-relationships-attributes.md index adbcc7df7..42e3a70d5 100644 --- a/docs/tutorial/relationship-attributes/define-relationships-attributes.md +++ b/docs/tutorial/relationship-attributes/define-relationships-attributes.md @@ -220,7 +220,7 @@ if hero.team: ## Optional Relationship Attributes -Notice that in the `Hero` class, the type annotation for `team` is `Optional[Team]`. +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+). This means that this attribute could be `None`, or it could be a full `Team` object.