Skip to content

Commit 330911a

Browse files
authored
move InitErrorDetails to be public (#513)
1 parent f6657a4 commit 330911a

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

pydantic_core/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
'ArgsKwargs',
4343
'SchemaError',
4444
'ErrorDetails',
45+
'InitErrorDetails',
4546
'ValidationError',
4647
'PydanticCustomError',
4748
'PydanticKnownError',
@@ -59,3 +60,10 @@ class ErrorDetails(_TypedDict):
5960
msg: str
6061
input: _Any
6162
ctx: _NotRequired['dict[str, str | int | float]']
63+
64+
65+
class InitErrorDetails(_TypedDict):
66+
type: 'str | PydanticCustomError'
67+
loc: _NotRequired['tuple[int | str, ...]']
68+
input: _Any
69+
ctx: _NotRequired['dict[str, str | int | float]']

pydantic_core/_pydantic_core.pyi

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import decimal
22
import sys
33
from typing import Any
44

5-
from pydantic_core import ErrorDetails
5+
from pydantic_core import ErrorDetails, InitErrorDetails
66
from pydantic_core.core_schema import CoreConfig, CoreSchema, ErrorType
77

88
if sys.version_info < (3, 9):
@@ -170,12 +170,6 @@ class SchemaError(Exception):
170170
def error_count(self) -> int: ...
171171
def errors(self) -> 'list[ErrorDetails]': ...
172172

173-
class InitErrorDetails(TypedDict):
174-
type: 'str | PydanticCustomError'
175-
loc: NotRequired['tuple[int | str, ...]']
176-
input: Any
177-
ctx: NotRequired['dict[str, str | int | float]']
178-
179173
class ValidationError(ValueError):
180174
def __init__(
181175
self, title: str, errors: 'list[InitErrorDetails]', error_mode: Literal['python', 'json'] = 'python'

0 commit comments

Comments
 (0)