Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/pydantic/pydantic
/ Foo
Class
Foo
tests/test_forward_ref.py:54–55 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
52
from
pydantic
import
BaseModel, PydanticUserError
53
54
class
Foo(BaseModel):
55
a: Optional[
'Bar'
] = None
56
57
with
pytest.raises(PydanticUserError, match=
'`Foo` is not fully defined; you should define `Bar`,'
):
58
Foo(a={
'b'
: {
'a'
: {}}})
Callers
4
module
Function · 0.70
test_self_forward_ref_local
Function · 0.70
test_forward_ref_in_generic
Function · 0.70
test_forward_ref_in_generic_separate_modules
Function · 0.70
Calls
1
Field
Function · 0.90
Tested by
4
module
Function · 0.56
test_self_forward_ref_local
Function · 0.56
test_forward_ref_in_generic
Function · 0.56
test_forward_ref_in_generic_separate_modules
Function · 0.56