-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use pydantic.JsonValue instead of own alias
- Loading branch information
Showing
6 changed files
with
10 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,9 @@ | ||
# This file is part of QuestionPy. (https://questionpy.org) | ||
# QuestionPy is free software released under terms of the MIT license. See LICENSE.md. | ||
# (c) Technische Universität Berlin, innoCampus <[email protected]> | ||
from collections.abc import ( | ||
Mapping, | ||
Sequence, # noqa: F401 | ||
) | ||
from typing import ( | ||
TypeAlias, | ||
Union, # noqa: F401, | ||
) | ||
|
||
from pydantic import BaseModel | ||
from typing_extensions import TypeAliasType | ||
|
||
|
||
class Localized(BaseModel): | ||
lang: str | ||
|
||
|
||
# "Regular" recursive type aliases break Pydantic: https://github.com/pydantic/pydantic/issues/8346 | ||
PlainValue: TypeAlias = TypeAliasType("PlainValue", "Union[None, int, str, bool, Sequence[PlainValue], PlainMapping]") | ||
PlainMapping: TypeAlias = TypeAliasType("PlainMapping", Mapping[str, PlainValue]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.