Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/pydantic/pydantic
/ Pet
Class
Pet
tests/test_forward_ref.py:504–505 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
502
from
pydantic
import
BaseModel, Field
503
504
class
Pet(BaseModel):
505
pet: Union[
'Cat'
,
'Dog'
] = Field(discriminator=
'type'
)
506
507
class
Cat(BaseModel):
508
type: Literal[
'cat'
]
Callers
nothing calls this directly
Calls
1
Field
Function · 0.90
Tested by
no test coverage detected