📝 Add docs recommending Union over Optional and migrate source examples (#4908)

* 📝 Add docs recommending Union over Optional

* 📝 Update docs recommending Union over Optional

* 📝 Update source examples for docs, recommend Union over Optional

* 📝 Update highlighted lines with updated source examples

* 📝 Update highlighted lines in Markdown with recent code changes

* 📝 Update docs, use Union instead of Optional

* ♻️ Update source examples to recommend Union over Optional

* 🎨 Update highlighted code in Markdown after moving from Optional to Union
This commit is contained in:
Sebastián Ramírez
2022-05-14 06:59:59 -05:00
committed by GitHub
parent c5be1b0550
commit ca437cdfab
131 changed files with 489 additions and 426 deletions

View File

@@ -43,7 +43,7 @@
因此,你可以将函数声明为:
```Python hl_lines="8"
```Python hl_lines="7"
{!../../../docs_src/path_params_numeric_validations/tutorial002.py!}
```
@@ -55,7 +55,7 @@
Python 不会对该 `*` 做任何事情,但是它将知道之后的所有参数都应作为关键字参数(键值对),也被称为 <abbr title="来自K-ey W-ord Arg-uments"><code>kwargs</code></abbr>,来调用。即使它们没有默认值。
```Python hl_lines="8"
```Python hl_lines="7"
{!../../../docs_src/path_params_numeric_validations/tutorial003.py!}
```