- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for uniqBy (0.17 sec)
-
docs/en/docs/tutorial/body-nested-models.md
{!> ../../../docs_src/body_nested_models/tutorial002.py!} ``` ## Set types But then we think about it, and realize that tags shouldn't repeat, they would probably be unique strings. And Python has a special data type for sets of unique items, the `set`. Then we can declare `tags` as a set of strings: === "Python 3.10+" ```Python hl_lines="12"
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Mar 22 01:42:11 GMT 2024 - 9.5K bytes - Viewed (0) -
docs/ko/docs/tutorial/body-nested-models.md
마찬가지로 예제에서 `tags`를 구체적으로 "문자열의 리스트"로 만들 수 있습니다: ```Python hl_lines="14" {!../../../docs_src/body_nested_models/tutorial002.py!} ``` ## 집합 타입 그런데 생각해보니 태그는 반복되면 안 돼고, 고유한(Unique) 문자열이어야 할 것 같습니다. 그리고 파이썬은 집합을 위한 특별한 데이터 타입 `set`이 있습니다. 그렇다면 `Set`을 임포트 하고 `tags`를 `str`의 `set`으로 선언할 수 있습니다: ```Python hl_lines="1 14" {!../../../docs_src/body_nested_models/tutorial003.py!} ```
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Mar 22 01:42:11 GMT 2024 - 7.6K bytes - Viewed (0)