Skip to content

Commit 16331d7

Browse files
authored
Fix variance issue in _IncEx type alias, only allow True (#1453)
1 parent ba8eab4 commit 16331d7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

python/pydantic_core/_pydantic_core.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import datetime
2+
from collections.abc import Mapping
23
from typing import Any, Callable, Generic, Literal, TypeVar, final
34

45
from _typeshed import SupportsAllComparisons
@@ -237,7 +238,7 @@ class SchemaValidator:
237238
`None` if the schema has no default value, otherwise a [`Some`][pydantic_core.Some] containing the default.
238239
"""
239240

240-
_IncEx: TypeAlias = set[int] | set[str] | dict[int, _IncEx | bool] | dict[str, _IncEx | bool]
241+
_IncEx: TypeAlias = set[int] | set[str] | Mapping[int, _IncEx | Literal[True]] | Mapping[str, _IncEx | Literal[True]]
241242

242243
@final
243244
class SchemaSerializer:

0 commit comments

Comments
 (0)