1
+ from __future__ import annotations
2
+
1
3
import decimal
2
4
import sys
3
5
from typing import Any , Callable , Generic , Type , TypeVar
@@ -55,52 +57,52 @@ class Some(Generic[_T]):
55
57
56
58
@final
57
59
class SchemaValidator :
58
- def __init__ (self , schema : CoreSchema , config : ' CoreConfig | None' = None ) -> None : ...
60
+ def __init__ (self , schema : CoreSchema , config : CoreConfig | None = None ) -> None : ...
59
61
@property
60
62
def title (self ) -> str : ...
61
63
def validate_python (
62
64
self ,
63
65
input : Any ,
64
66
* ,
65
- strict : ' bool | None' = None ,
66
- from_attributes : ' bool | None' = None ,
67
+ strict : bool | None = None ,
68
+ from_attributes : bool | None = None ,
67
69
context : Any = None ,
68
- self_instance : ' Any | None' = None ,
70
+ self_instance : Any | None = None ,
69
71
) -> Any : ...
70
72
def isinstance_python (
71
73
self ,
72
74
input : Any ,
73
75
* ,
74
- strict : ' bool | None' = None ,
75
- from_attributes : ' bool | None' = None ,
76
+ strict : bool | None = None ,
77
+ from_attributes : bool | None = None ,
76
78
context : Any = None ,
77
- self_instance : ' Any | None' = None ,
79
+ self_instance : Any | None = None ,
78
80
) -> bool : ...
79
81
def validate_json (
80
82
self ,
81
- input : ' str | bytes | bytearray' ,
83
+ input : str | bytes | bytearray ,
82
84
* ,
83
- strict : ' bool | None' = None ,
85
+ strict : bool | None = None ,
84
86
context : Any = None ,
85
- self_instance : ' Any | None' = None ,
87
+ self_instance : Any | None = None ,
86
88
) -> Any : ...
87
89
def validate_assignment (
88
90
self ,
89
91
obj : Any ,
90
92
field_name : str ,
91
93
field_value : Any ,
92
94
* ,
93
- strict : ' bool | None' = None ,
94
- from_attributes : ' bool | None' = None ,
95
+ strict : bool | None = None ,
96
+ from_attributes : bool | None = None ,
95
97
context : Any = None ,
96
- ) -> ' dict[str, Any]' : ...
97
- def get_default_value (self , * , strict : ' bool | None' = None , context : Any = None ) -> Some | None : ...
98
+ ) -> dict [str , Any ]: ...
99
+ def get_default_value (self , * , strict : bool | None = None , context : Any = None ) -> Some | None : ...
98
100
99
- _IncEx : TypeAlias = ' set[int] | set[str] | dict[int, _IncEx] | dict[str, _IncEx] | None'
101
+ _IncEx : TypeAlias = set [int ] | set [str ] | dict [int , _IncEx ] | dict [str , _IncEx ] | None
100
102
101
103
@final
102
104
class SchemaSerializer :
103
- def __init__ (self , schema : CoreSchema , config : ' CoreConfig | None' = None ) -> None : ...
105
+ def __init__ (self , schema : CoreSchema , config : CoreConfig | None = None ) -> None : ...
104
106
def to_python (
105
107
self ,
106
108
value : Any ,
@@ -114,7 +116,7 @@ class SchemaSerializer:
114
116
exclude_none : bool = False ,
115
117
round_trip : bool = False ,
116
118
warnings : bool = True ,
117
- fallback : ' Callable[[Any], Any] | None' = None ,
119
+ fallback : Callable [[Any ], Any ] | None = None ,
118
120
) -> Any : ...
119
121
def to_json (
120
122
self ,
@@ -129,7 +131,7 @@ class SchemaSerializer:
129
131
exclude_none : bool = False ,
130
132
round_trip : bool = False ,
131
133
warnings : bool = True ,
132
- fallback : ' Callable[[Any], Any] | None' = None ,
134
+ fallback : Callable [[Any ], Any ] | None = None ,
133
135
) -> bytes : ...
134
136
135
137
def to_json (
@@ -144,7 +146,7 @@ def to_json(
144
146
timedelta_mode : Literal ['iso8601' , 'float' ] = 'iso8601' ,
145
147
bytes_mode : Literal ['utf8' , 'base64' ] = 'utf8' ,
146
148
serialize_unknown : bool = False ,
147
- fallback : ' Callable[[Any], Any] | None' = None ,
149
+ fallback : Callable [[Any ], Any ] | None = None ,
148
150
) -> bytes : ...
149
151
def to_jsonable_python (
150
152
value : Any ,
@@ -157,29 +159,29 @@ def to_jsonable_python(
157
159
timedelta_mode : Literal ['iso8601' , 'float' ] = 'iso8601' ,
158
160
bytes_mode : Literal ['utf8' , 'base64' ] = 'utf8' ,
159
161
serialize_unknown : bool = False ,
160
- fallback : ' Callable[[Any], Any] | None' = None ,
162
+ fallback : Callable [[Any ], Any ] | None = None ,
161
163
) -> Any : ...
162
164
163
165
class Url (SupportsAllComparisons ):
164
166
def __init__ (self , url : str ) -> None : ...
165
167
@property
166
168
def scheme (self ) -> str : ...
167
169
@property
168
- def username (self ) -> ' str | None' : ...
170
+ def username (self ) -> str | None : ...
169
171
@property
170
- def password (self ) -> ' str | None' : ...
172
+ def password (self ) -> str | None : ...
171
173
@property
172
- def host (self ) -> ' str | None' : ...
174
+ def host (self ) -> str | None : ...
173
175
@property
174
- def port (self ) -> ' int | None' : ...
176
+ def port (self ) -> int | None : ...
175
177
@property
176
- def path (self ) -> ' str | None' : ...
178
+ def path (self ) -> str | None : ...
177
179
@property
178
- def query (self ) -> ' str | None' : ...
180
+ def query (self ) -> str | None : ...
179
181
@property
180
- def fragment (self ) -> ' str | None' : ...
181
- def unicode_host (self ) -> ' str | None' : ...
182
- def query_params (self ) -> ' list[tuple[str, str]]' : ...
182
+ def fragment (self ) -> str | None : ...
183
+ def unicode_host (self ) -> str | None : ...
184
+ def query_params (self ) -> list [tuple [str , str ]]: ...
183
185
def unicode_string (self ) -> str : ...
184
186
def __repr__ (self ) -> str : ...
185
187
def __str__ (self ) -> str : ...
@@ -190,13 +192,13 @@ class MultiHostUrl(SupportsAllComparisons):
190
192
@property
191
193
def scheme (self ) -> str : ...
192
194
@property
193
- def path (self ) -> ' str | None' : ...
195
+ def path (self ) -> str | None : ...
194
196
@property
195
- def query (self ) -> ' str | None' : ...
197
+ def query (self ) -> str | None : ...
196
198
@property
197
- def fragment (self ) -> ' str | None' : ...
198
- def hosts (self ) -> ' list[MultiHostHost]' : ...
199
- def query_params (self ) -> ' list[tuple[str, str]]' : ...
199
+ def fragment (self ) -> str | None : ...
200
+ def hosts (self ) -> list [MultiHostHost ]: ...
201
+ def query_params (self ) -> list [tuple [str , str ]]: ...
200
202
def unicode_string (self ) -> str : ...
201
203
def __repr__ (self ) -> str : ...
202
204
def __str__ (self ) -> str : ...
@@ -205,14 +207,14 @@ class MultiHostUrl(SupportsAllComparisons):
205
207
@final
206
208
class SchemaError (Exception ):
207
209
def error_count (self ) -> int : ...
208
- def errors (self ) -> ' list[ErrorDetails]' : ...
210
+ def errors (self ) -> list [ErrorDetails ]: ...
209
211
210
212
@final
211
213
class ValidationError (ValueError ):
212
214
@staticmethod
213
215
def from_exception_data (
214
216
title : str ,
215
- line_errors : ' list[InitErrorDetails]' ,
217
+ line_errors : list [InitErrorDetails ],
216
218
error_mode : Literal ['python' , 'json' ] = 'python' ,
217
219
hide_input : bool = False ,
218
220
) -> ValidationError :
@@ -225,16 +227,16 @@ class ValidationError(ValueError):
225
227
@property
226
228
def title (self ) -> str : ...
227
229
def error_count (self ) -> int : ...
228
- def errors (self , * , include_url : bool = True , include_context : bool = True ) -> ' list[ErrorDetails]' : ...
229
- def json (self , * , indent : ' int | None' = None , include_url : bool = True , include_context : bool = True ) -> str : ...
230
+ def errors (self , * , include_url : bool = True , include_context : bool = True ) -> list [ErrorDetails ]: ...
231
+ def json (self , * , indent : int | None = None , include_url : bool = True , include_context : bool = True ) -> str : ...
230
232
231
233
@final
232
234
class PydanticCustomError (ValueError ):
233
235
def __init__ (
234
- self , error_type : LiteralString , message_template : LiteralString , context : ' dict[str, Any] | None' = None
236
+ self , error_type : LiteralString , message_template : LiteralString , context : dict [str , Any ] | None = None
235
237
) -> None : ...
236
238
@property
237
- def context (self ) -> ' dict[str, Any] | None' : ...
239
+ def context (self ) -> dict [str , Any ] | None : ...
238
240
@property
239
241
def type (self ) -> str : ...
240
242
@property
@@ -244,10 +246,10 @@ class PydanticCustomError(ValueError):
244
246
@final
245
247
class PydanticKnownError (ValueError ):
246
248
def __init__ (
247
- self , error_type : ErrorType , context : ' dict[str, str | int | float | decimal.Decimal] | None' = None
249
+ self , error_type : ErrorType , context : dict [str , str | int | float | decimal .Decimal ] | None = None
248
250
) -> None : ...
249
251
@property
250
- def context (self ) -> ' dict[str, str | int | float] | None' : ...
252
+ def context (self ) -> dict [str , str | int | float ] | None : ...
251
253
@property
252
254
def type (self ) -> ErrorType : ...
253
255
@property
@@ -264,15 +266,15 @@ class PydanticSerializationError(ValueError):
264
266
265
267
@final
266
268
class PydanticSerializationUnexpectedValue (ValueError ):
267
- def __init__ (self , message : ' str | None' = None ) -> None : ...
269
+ def __init__ (self , message : str | None = None ) -> None : ...
268
270
269
271
@final
270
272
class ArgsKwargs :
271
- def __init__ (self , args : ' tuple[Any, ...]' , kwargs : ' dict[str, Any] | None' = None ) -> None : ...
273
+ def __init__ (self , args : tuple [Any , ...], kwargs : dict [str , Any ] | None = None ) -> None : ...
272
274
@property
273
- def args (self ) -> ' tuple[Any, ...]' : ...
275
+ def args (self ) -> tuple [Any , ...]: ...
274
276
@property
275
- def kwargs (self ) -> ' dict[str, Any] | None' : ...
277
+ def kwargs (self ) -> dict [str , Any ] | None : ...
276
278
277
279
@final
278
280
class PydanticUndefinedType :
@@ -281,7 +283,7 @@ class PydanticUndefinedType:
281
283
282
284
PydanticUndefined : PydanticUndefinedType
283
285
284
- def list_all_errors () -> ' list[ErrorTypeInfo]' :
286
+ def list_all_errors () -> list [ErrorTypeInfo ]:
285
287
"""
286
288
Get information about all built-in errors.
287
289
"""
0 commit comments