Coverage for pydantic/_internal/_forward_ref.py: 100.00%
13 statements
« prev ^ index » next coverage.py v7.9.1, created at 2025-07-01 21:48 +0000
« prev ^ index » next coverage.py v7.9.1, created at 2025-07-01 21:48 +0000
1from __future__ import annotations as _annotations 1abcdefghijklmnopqrstuvwxJyzABCDEFGHI
3from dataclasses import dataclass 1abcdefghijklmnopqrstuvwxJyzABCDEFGHI
4from typing import Union 1abcdefghijklmnopqrstuvwxJyzABCDEFGHI
7@dataclass 1abcdefghijklmnopqrstuvwxJyzABCDEFGHI
8class PydanticRecursiveRef: 1abcdefghijklmnopqrstuvwxJyzABCDEFGHI
9 type_ref: str 1abcdefghijklmnopqrstuvwxJyzABCDEFGHI
11 __name__ = 'PydanticRecursiveRef' 1abcdefghijklmnopqrstuvwxJyzABCDEFGHI
12 __hash__ = object.__hash__ 1abcdefghijklmnopqrstuvwxJyzABCDEFGHI
14 def __call__(self) -> None: 1abcdefghijklmnopqrstuvwxJyzABCDEFGHI
15 """Defining __call__ is necessary for the `typing` module to let you use an instance of
16 this class as the result of resolving a standard ForwardRef.
17 """
19 def __or__(self, other): 1abcdefghijklmnopqrstuvwxJyzABCDEFGHI
20 return Union[self, other] # type: ignore 1abcdefghijklmnopqrstuvwxyzABCDEFGHI
22 def __ror__(self, other): 1abcdefghijklmnopqrstuvwxJyzABCDEFGHI
23 return Union[other, self] # type: ignore 1abcdefghijklmnopqrstuvwxyzABCDEFGHI