]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
🌐 Add Korean translation for `docs/ko/docs/tutorial/extra-data-types.md` (#11711)
authorNayeon Kim <98254573+nayeonkinn@users.noreply.github.com>
Fri, 14 Jun 2024 02:45:10 +0000 (11:45 +0900)
committerGitHub <noreply@github.com>
Fri, 14 Jun 2024 02:45:10 +0000 (21:45 -0500)
docs/ko/docs/tutorial/extra-data-types.md [new file with mode: 0644]

diff --git a/docs/ko/docs/tutorial/extra-data-types.md b/docs/ko/docs/tutorial/extra-data-types.md
new file mode 100644 (file)
index 0000000..673cf5b
--- /dev/null
@@ -0,0 +1,130 @@
+# μΆ”κ°€ λ°μ΄ν„° μžλ£Œν˜•
+
+μ§€κΈˆκΉŒμ§€ μΌλ°˜μ μΈ λ°μ΄ν„° μžλ£Œν˜•을 μ‚¬μš©ν–ˆμŠ΅λ‹ˆλ‹€. μ˜ˆλ₯Ό λ“€λ©΄ λ‹€μŒκ³Ό κ°™μŠ΅λ‹ˆλ‹€:
+
+* `int`
+* `float`
+* `str`
+* `bool`
+
+ν•˜μ§€λ§Œ λ” λ³΅μž‘ν•œ λ°μ΄ν„° μžλ£Œν˜• λ˜ν•œ μ‚¬μš©ν•  μˆ˜ μžˆμŠ΅λ‹ˆλ‹€.
+
+그리고 μ§€κΈˆκΉŒμ§€μ™€ κ°™μ€ κΈ°λŠ₯듀을 μ—¬μ „νžˆ μ‚¬μš©ν•  μˆ˜ μžˆμŠ΅λ‹ˆλ‹€.
+
+* ν›Œλ₯­ν•œ νŽΈμ§‘κΈ° μ§€μ›.
+* λ“€μ–΄μ˜€λŠ” μš”μ²­μ˜ λ°μ΄ν„° λ³€ν™˜.
+* μ‘λ‹΅ λ°μ΄ν„°μ˜ λ°μ΄ν„° λ³€ν™˜.
+* λ°μ΄ν„° κ²€μ¦.
+* μžλ™ μ–΄λ…Έν…Œμ΄μ…˜κ³Ό λ¬Έμ„œν™”.
+
+## λ‹€λ₯Έ λ°μ΄ν„° μžλ£Œν˜•
+
+μ•„λž˜μ˜ μΆ”가적인 λ°μ΄ν„° μžλ£Œν˜•을 μ‚¬μš©ν•  μˆ˜ μžˆμŠ΅λ‹ˆλ‹€:
+
+* `UUID`:
+    * ν‘œμ€€ "λ²”μš© κ³ μœ  μ‹λ³„μž"둜, λ§Žμ€ λ°μ΄ν„°λ² μ΄μŠ€μ™€ μ‹œμŠ€ν…œμ—μ„œ ID둜 μ‚¬μš©λ©λ‹ˆλ‹€.
+    * μš”μ²­κ³Ό μ‘λ‹΅μ—μ„œ `str`둜 ν‘œν˜„λ©λ‹ˆλ‹€.
+* `datetime.datetime`:
+    * νŒŒμ΄μ¬μ˜ `datetime.datetime`.
+    * μš”μ²­κ³Ό μ‘λ‹΅μ—μ„œ `2008-09-15T15:53:00+05:00`와 κ°™μ€ ISO 8601 ν˜•μ‹μ˜ `str`둜 ν‘œν˜„λ©λ‹ˆλ‹€.
+* `datetime.date`:
+    * νŒŒμ΄μ¬μ˜ `datetime.date`.
+    * μš”μ²­κ³Ό μ‘λ‹΅μ—μ„œ `2008-09-15`와 κ°™μ€ ISO 8601 ν˜•μ‹μ˜ `str`둜 ν‘œν˜„λ©λ‹ˆλ‹€.
+* `datetime.time`:
+    * νŒŒμ΄μ¬μ˜ `datetime.time`.
+    * μš”μ²­κ³Ό μ‘λ‹΅μ—μ„œ `14:23:55.003`와 κ°™μ€ ISO 8601 ν˜•μ‹μ˜ `str`둜 ν‘œν˜„λ©λ‹ˆλ‹€.
+* `datetime.timedelta`:
+    * νŒŒμ΄μ¬μ˜ `datetime.timedelta`.
+    * μš”μ²­κ³Ό μ‘λ‹΅μ—μ„œ μ „체 μ΄ˆ(seconds)의 `float`둜 ν‘œν˜„λ©λ‹ˆλ‹€.
+    * Pydantic은 "ISO 8601 μ‹œμ°¨ μΈμ½”λ”©"으둜 ν‘œν˜„ν•˜λŠ” κ²ƒ λ˜ν•œ ν—ˆμš©ν•©λ‹ˆλ‹€. <a href="https://docs.pydantic.dev/latest/concepts/serialization/#json_encoders" class="external-link" target="_blank">더 λ§Žμ€ μ •λ³΄λŠ” μ΄ λ¬Έμ„œμ—μ„œ ν™•μΈν•˜μ‹­μ‹œμ˜€.</a>.
+* `frozenset`:
+    * μš”μ²­κ³Ό μ‘λ‹΅μ—μ„œ `set`와 λ™μΌν•˜κ²Œ μ·¨κΈ‰λ©λ‹ˆλ‹€:
+        * μš”μ²­ μ‹œ, λ¦¬μŠ€νŠΈλ₯Ό μ½μ–΄ μ€‘볡을 μ œκ±°ν•˜κ³  `set`둜 λ³€ν™˜ν•©λ‹ˆλ‹€.
+        * μ‘λ‹΅ μ‹œ, `set`λŠ” `list`둜 λ³€ν™˜λ©λ‹ˆλ‹€.
+        * μƒμ„±λœ μŠ€ν‚€λ§ˆλŠ” (JSON μŠ€ν‚€λ§ˆμ˜ `uniqueItems`λ₯Ό μ΄μš©ν•΄) `set`의 κ°’이 κ³ μœ ν•¨μ„ λͺ…μ‹œν•©λ‹ˆλ‹€.
+* `bytes`:
+    * ν‘œμ€€ νŒŒμ΄μ¬μ˜ `bytes`.
+    * μš”μ²­κ³Ό μ‘λ‹΅μ—μ„œ `str`둜 μ·¨κΈ‰λ©λ‹ˆλ‹€.
+    * μƒμ„±λœ μŠ€ν‚€λ§ˆλŠ” μ΄κ²ƒμ΄ `binary` "ν˜•μ‹"의 `str`μž„μ„ λͺ…μ‹œν•©λ‹ˆλ‹€.
+* `Decimal`:
+    * ν‘œμ€€ νŒŒμ΄μ¬μ˜ `Decimal`.
+    * μš”μ²­κ³Ό μ‘λ‹΅μ—μ„œ `float`와 λ™μΌν•˜κ²Œ λ‹€λ€„μ§‘λ‹ˆλ‹€.
+* μ—¬κΈ°μ—μ„œ λͺ¨λ“  μœ νš¨ν•œ pydantic λ°μ΄ν„° μžλ£Œν˜•을 ν™•인할 μˆ˜ μžˆμŠ΅λ‹ˆλ‹€: <a href="https://docs.pydantic.dev/latest/usage/types/types/" class="external-link" target="_blank">Pydantic λ°μ΄ν„° μžλ£Œν˜•</a>.
+
+## μ˜ˆμ‹œ
+
+μœ„μ˜ λͺ‡λͺ‡ μžλ£Œν˜•을 λ§€κ°œλ³€μˆ˜λ‘œ μ‚¬μš©ν•˜λŠ” *경둜 μž‘동* μ˜ˆμ‹œμž…λ‹ˆλ‹€.
+
+=== "Python 3.10+"
+
+    ```Python hl_lines="1  3  12-16"
+    {!> ../../../docs_src/extra_data_types/tutorial001_an_py310.py!}
+    ```
+
+=== "Python 3.9+"
+
+    ```Python hl_lines="1  3  12-16"
+    {!> ../../../docs_src/extra_data_types/tutorial001_an_py39.py!}
+    ```
+
+=== "Python 3.8+"
+
+    ```Python hl_lines="1  3  13-17"
+    {!> ../../../docs_src/extra_data_types/tutorial001_an.py!}
+    ```
+
+=== "Python 3.10+ non-Annotated"
+
+    !!! tip
+        Prefer to use the `Annotated` version if possible.
+
+    ```Python hl_lines="1  2  11-15"
+    {!> ../../../docs_src/extra_data_types/tutorial001_py310.py!}
+    ```
+
+=== "Python 3.8+ non-Annotated"
+
+    !!! tip
+        Prefer to use the `Annotated` version if possible.
+
+    ```Python hl_lines="1  2  12-16"
+    {!> ../../../docs_src/extra_data_types/tutorial001.py!}
+    ```
+
+ν•¨μˆ˜ μ•ˆμ˜ λ§€κ°œλ³€μˆ˜κ°€ κ·Έλ“€λ§Œμ˜ λ°μ΄ν„° μžλ£Œν˜•을 κ°€μ§€κ³  μžˆμœΌλ©°, μ˜ˆλ₯Ό λ“€μ–΄, λ‹€μŒκ³Ό κ°™μ΄ λ‚ μ§œλ₯Ό μ‘°μž‘ν•  μˆ˜ μžˆμŒμ„ μ°Έκ³ ν•˜μ‹­μ‹œμ˜€:
+
+=== "Python 3.10+"
+
+    ```Python hl_lines="18-19"
+    {!> ../../../docs_src/extra_data_types/tutorial001_an_py310.py!}
+    ```
+
+=== "Python 3.9+"
+
+    ```Python hl_lines="18-19"
+    {!> ../../../docs_src/extra_data_types/tutorial001_an_py39.py!}
+    ```
+
+=== "Python 3.8+"
+
+    ```Python hl_lines="19-20"
+    {!> ../../../docs_src/extra_data_types/tutorial001_an.py!}
+    ```
+
+=== "Python 3.10+ non-Annotated"
+
+    !!! tip
+        Prefer to use the `Annotated` version if possible.
+
+    ```Python hl_lines="17-18"
+    {!> ../../../docs_src/extra_data_types/tutorial001_py310.py!}
+    ```
+
+=== "Python 3.8+ non-Annotated"
+
+    !!! tip
+        Prefer to use the `Annotated` version if possible.
+
+    ```Python hl_lines="18-19"
+    {!> ../../../docs_src/extra_data_types/tutorial001.py!}
+    ```