Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfb6117a

Browse files
authored
Remove unneeded logic inUuidVersion (#11940)
1 parentf0e1d04 commitfb6117a

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

‎pydantic/types.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ class UuidVersion:
11421142
Use this class as an annotation via [`Annotated`](https://docs.python.org/3/library/typing.html#typing.Annotated), as seen below.
11431143
11441144
Attributes:
1145-
uuid_version: The version of the UUID. Must be one of 1, 3, 4, 5,or 7.
1145+
uuid_version: The version of the UUID. Must be one of 1, 3, 4, 5,6, 7 or 8.
11461146
11471147
Example:
11481148
```python
@@ -1166,15 +1166,10 @@ def __get_pydantic_json_schema__(
11661166
returnfield_schema
11671167

11681168
def__get_pydantic_core_schema__(self,source:Any,handler:GetCoreSchemaHandler)->core_schema.CoreSchema:
1169-
ifisinstance(self,source):
1170-
# used directly as a type
1171-
returncore_schema.uuid_schema(version=self.uuid_version)
1172-
else:
1173-
# update existing schema with self.uuid_version
1174-
schema=handler(source)
1175-
_check_annotated_type(schema['type'],'uuid',self.__class__.__name__)
1176-
schema['version']=self.uuid_version# type: ignore
1177-
returnschema
1169+
schema=handler(source)
1170+
_check_annotated_type(schema['type'],'uuid',self.__class__.__name__)
1171+
schema['version']=self.uuid_version# type: ignore
1172+
returnschema
11781173

11791174
def__hash__(self)->int:
11801175
returnhash(type(self.uuid_version))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp