1
+ from __future__ import annotations
2
+
1
3
import decimal
2
4
import sys
3
5
from typing import Any , Callable , Generic , TypeVar
@@ -44,51 +46,51 @@ class Some(Generic[T]):
44
46
def value (self ) -> T : ...
45
47
46
48
class SchemaValidator :
47
- def __init__ (self , schema : CoreSchema , config : ' CoreConfig | None' = None ) -> None : ...
49
+ def __init__ (self , schema : CoreSchema , config : CoreConfig | None = None ) -> None : ...
48
50
@property
49
51
def title (self ) -> str : ...
50
52
def validate_python (
51
53
self ,
52
54
input : Any ,
53
55
* ,
54
- strict : ' bool | None' = None ,
55
- from_attributes : ' bool | None' = None ,
56
+ strict : bool | None = None ,
57
+ from_attributes : bool | None = None ,
56
58
context : Any = None ,
57
- self_instance : ' Any | None' = None ,
59
+ self_instance : Any | None = None ,
58
60
) -> Any : ...
59
61
def isinstance_python (
60
62
self ,
61
63
input : Any ,
62
64
* ,
63
- strict : ' bool | None' = None ,
64
- from_attributes : ' bool | None' = None ,
65
+ strict : bool | None = None ,
66
+ from_attributes : bool | None = None ,
65
67
context : Any = None ,
66
- self_instance : ' Any | None' = None ,
68
+ self_instance : Any | None = None ,
67
69
) -> bool : ...
68
70
def validate_json (
69
71
self ,
70
- input : ' str | bytes | bytearray' ,
72
+ input : str | bytes | bytearray ,
71
73
* ,
72
- strict : ' bool | None' = None ,
74
+ strict : bool | None = None ,
73
75
context : Any = None ,
74
- self_instance : ' Any | None' = None ,
76
+ self_instance : Any | None = None ,
75
77
) -> Any : ...
76
78
def validate_assignment (
77
79
self ,
78
80
obj : Any ,
79
81
field_name : str ,
80
82
field_value : Any ,
81
83
* ,
82
- strict : ' bool | None' = None ,
83
- from_attributes : ' bool | None' = None ,
84
+ strict : bool | None = None ,
85
+ from_attributes : bool | None = None ,
84
86
context : Any = None ,
85
- ) -> ' dict[str, Any]' : ...
86
- def get_default_value (self , * , strict : ' bool | None' = None , context : Any = None ) -> Some | None : ...
87
+ ) -> dict [str , Any ]: ...
88
+ def get_default_value (self , * , strict : bool | None = None , context : Any = None ) -> Some | None : ...
87
89
88
- IncEx : TypeAlias = ' set[int] | set[str] | dict[int, IncEx] | dict[str, IncEx] | None'
90
+ IncEx : TypeAlias = set [int ] | set [str ] | dict [int , IncEx ] | dict [str , IncEx ] | None
89
91
90
92
class SchemaSerializer :
91
- def __init__ (self , schema : CoreSchema , config : ' CoreConfig | None' = None ) -> None : ...
93
+ def __init__ (self , schema : CoreSchema , config : CoreConfig | None = None ) -> None : ...
92
94
def to_python (
93
95
self ,
94
96
value : Any ,
@@ -102,7 +104,7 @@ class SchemaSerializer:
102
104
exclude_none : bool = False ,
103
105
round_trip : bool = False ,
104
106
warnings : bool = True ,
105
- fallback : ' Callable[[Any], Any] | None' = None ,
107
+ fallback : Callable [[Any ], Any ] | None = None ,
106
108
) -> Any : ...
107
109
def to_json (
108
110
self ,
@@ -117,7 +119,7 @@ class SchemaSerializer:
117
119
exclude_none : bool = False ,
118
120
round_trip : bool = False ,
119
121
warnings : bool = True ,
120
- fallback : ' Callable[[Any], Any] | None' = None ,
122
+ fallback : Callable [[Any ], Any ] | None = None ,
121
123
) -> bytes : ...
122
124
123
125
def to_json (
@@ -132,7 +134,7 @@ def to_json(
132
134
timedelta_mode : Literal ['iso8601' , 'float' ] = 'iso8601' ,
133
135
bytes_mode : Literal ['utf8' , 'base64' ] = 'utf8' ,
134
136
serialize_unknown : bool = False ,
135
- fallback : ' Callable[[Any], Any] | None' = None ,
137
+ fallback : Callable [[Any ], Any ] | None = None ,
136
138
) -> bytes : ...
137
139
def to_jsonable_python (
138
140
value : Any ,
@@ -145,64 +147,64 @@ def to_jsonable_python(
145
147
timedelta_mode : Literal ['iso8601' , 'float' ] = 'iso8601' ,
146
148
bytes_mode : Literal ['utf8' , 'base64' ] = 'utf8' ,
147
149
serialize_unknown : bool = False ,
148
- fallback : ' Callable[[Any], Any] | None' = None ,
150
+ fallback : Callable [[Any ], Any ] | None = None ,
149
151
) -> Any : ...
150
152
151
153
class Url (SupportsAllComparisons ):
152
154
def __init__ (self , url : str ) -> None : ...
153
155
@property
154
156
def scheme (self ) -> str : ...
155
157
@property
156
- def username (self ) -> ' str | None' : ...
158
+ def username (self ) -> str | None : ...
157
159
@property
158
- def password (self ) -> ' str | None' : ...
160
+ def password (self ) -> str | None : ...
159
161
@property
160
- def host (self ) -> ' str | None' : ...
162
+ def host (self ) -> str | None : ...
161
163
@property
162
- def port (self ) -> ' int | None' : ...
164
+ def port (self ) -> int | None : ...
163
165
@property
164
- def path (self ) -> ' str | None' : ...
166
+ def path (self ) -> str | None : ...
165
167
@property
166
- def query (self ) -> ' str | None' : ...
168
+ def query (self ) -> str | None : ...
167
169
@property
168
- def fragment (self ) -> ' str | None' : ...
169
- def unicode_host (self ) -> ' str | None' : ...
170
- def query_params (self ) -> ' list[tuple[str, str]]' : ...
170
+ def fragment (self ) -> str | None : ...
171
+ def unicode_host (self ) -> str | None : ...
172
+ def query_params (self ) -> list [tuple [str , str ]]: ...
171
173
def unicode_string (self ) -> str : ...
172
174
def __repr__ (self ) -> str : ...
173
175
def __str__ (self ) -> str : ...
174
176
175
177
class MultiHostHost (TypedDict ):
176
- username : ' str | None'
177
- password : ' str | None'
178
- host : ' str | None'
179
- port : ' int | None'
178
+ username : str | None
179
+ password : str | None
180
+ host : str | None
181
+ port : int | None
180
182
181
183
class MultiHostUrl (SupportsAllComparisons ):
182
184
def __init__ (self , url : str ) -> None : ...
183
185
@property
184
186
def scheme (self ) -> str : ...
185
187
@property
186
- def path (self ) -> ' str | None' : ...
188
+ def path (self ) -> str | None : ...
187
189
@property
188
- def query (self ) -> ' str | None' : ...
190
+ def query (self ) -> str | None : ...
189
191
@property
190
- def fragment (self ) -> ' str | None' : ...
191
- def hosts (self ) -> ' list[MultiHostHost]' : ...
192
- def query_params (self ) -> ' list[tuple[str, str]]' : ...
192
+ def fragment (self ) -> str | None : ...
193
+ def hosts (self ) -> list [MultiHostHost ]: ...
194
+ def query_params (self ) -> list [tuple [str , str ]]: ...
193
195
def unicode_string (self ) -> str : ...
194
196
def __repr__ (self ) -> str : ...
195
197
def __str__ (self ) -> str : ...
196
198
197
199
class SchemaError (Exception ):
198
200
def error_count (self ) -> int : ...
199
- def errors (self ) -> ' list[ErrorDetails]' : ...
201
+ def errors (self ) -> list [ErrorDetails ]: ...
200
202
201
203
class ValidationError (ValueError ):
202
204
@staticmethod
203
205
def from_exception_data (
204
206
title : str ,
205
- errors : ' list[InitErrorDetails]' ,
207
+ errors : list [InitErrorDetails ],
206
208
error_mode : Literal ['python' , 'json' ] = 'python' ,
207
209
hide_input : bool = False ,
208
210
) -> ValidationError :
@@ -215,15 +217,15 @@ class ValidationError(ValueError):
215
217
@property
216
218
def title (self ) -> str : ...
217
219
def error_count (self ) -> int : ...
218
- def errors (self , * , include_url : bool = True , include_context : bool = True ) -> ' list[ErrorDetails]' : ...
219
- def json (self , * , indent : ' int | None' = None , include_url : bool = True , include_context : bool = True ) -> str : ...
220
+ def errors (self , * , include_url : bool = True , include_context : bool = True ) -> list [ErrorDetails ]: ...
221
+ def json (self , * , indent : int | None = None , include_url : bool = True , include_context : bool = True ) -> str : ...
220
222
221
223
class PydanticCustomError (ValueError ):
222
224
def __init__ (
223
- self , error_type : LiteralString , message_template : LiteralString , context : ' dict[str, Any] | None' = None
225
+ self , error_type : LiteralString , message_template : LiteralString , context : dict [str , Any ] | None = None
224
226
) -> None : ...
225
227
@property
226
- def context (self ) -> ' dict[str, Any] | None' : ...
228
+ def context (self ) -> dict [str , Any ] | None : ...
227
229
@property
228
230
def type (self ) -> str : ...
229
231
@property
@@ -232,10 +234,10 @@ class PydanticCustomError(ValueError):
232
234
233
235
class PydanticKnownError (ValueError ):
234
236
def __init__ (
235
- self , error_type : ErrorType , context : ' dict[str, str | int | float | decimal.Decimal] | None' = None
237
+ self , error_type : ErrorType , context : dict [str , str | int | float | decimal .Decimal ] | None = None
236
238
) -> None : ...
237
239
@property
238
- def context (self ) -> ' dict[str, str | int | float] | None' : ...
240
+ def context (self ) -> dict [str , str | int | float ] | None : ...
239
241
@property
240
242
def type (self ) -> ErrorType : ...
241
243
@property
@@ -249,28 +251,28 @@ class PydanticSerializationError(ValueError):
249
251
def __init__ (self , message : str ) -> None : ...
250
252
251
253
class PydanticSerializationUnexpectedValue (ValueError ):
252
- def __init__ (self , message : ' str | None' = None ) -> None : ...
254
+ def __init__ (self , message : str | None = None ) -> None : ...
253
255
254
256
class ErrorTypeInfo (TypedDict ):
255
257
type : ErrorType
256
258
message_template_python : str
257
259
example_message_python : str
258
260
message_template_json : NotRequired [str ]
259
261
example_message_json : NotRequired [str ]
260
- example_context : ' dict[str, str | int | float] | None'
262
+ example_context : dict [str , str | int | float ] | None
261
263
262
264
class ArgsKwargs :
263
- def __init__ (self , args : ' tuple[Any, ...]' , kwargs : ' dict[str, Any] | None' = None ) -> None : ...
265
+ def __init__ (self , args : tuple [Any , ...], kwargs : dict [str , Any ] | None = None ) -> None : ...
264
266
@property
265
- def args (self ) -> ' tuple[Any, ...]' : ...
267
+ def args (self ) -> tuple [Any , ...]: ...
266
268
@property
267
- def kwargs (self ) -> ' dict[str, Any] | None' : ...
269
+ def kwargs (self ) -> dict [str , Any ] | None : ...
268
270
269
271
class PydanticUndefinedType : ...
270
272
271
273
PydanticUndefined : PydanticUndefinedType
272
274
273
- def list_all_errors () -> ' list[ErrorTypeInfo]' :
275
+ def list_all_errors () -> list [ErrorTypeInfo ]:
274
276
"""
275
277
Get information about all built-in errors.
276
278
"""
0 commit comments