Skip to content

Commit c9f45e3

Browse files
authored
use LiteralString on PydanticCustomError (#562)
1 parent 9381862 commit c9f45e3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pydantic_core/_pydantic_core.pyi

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ else:
1111
from typing import TypedDict
1212

1313
if sys.version_info < (3, 11):
14-
from typing_extensions import Literal, NotRequired, TypeAlias
14+
from typing_extensions import Literal, LiteralString, NotRequired, TypeAlias
1515
else:
16-
from typing import Literal, NotRequired, TypeAlias
16+
from typing import Literal, LiteralString, NotRequired, TypeAlias
1717

1818
from _typeshed import SupportsAllComparisons
1919

@@ -189,7 +189,9 @@ class ValidationError(ValueError):
189189
def json(self, indent: 'int | None' = None, include_context: bool = False) -> str: ...
190190

191191
class PydanticCustomError(ValueError):
192-
def __init__(self, error_type: str, message_template: str, context: 'dict[str, Any] | None' = None) -> None: ...
192+
def __init__(
193+
self, error_type: LiteralString, message_template: LiteralString, context: 'dict[str, Any] | None' = None
194+
) -> None: ...
193195
@property
194196
def type(self) -> str: ...
195197
@property

0 commit comments

Comments
 (0)