mirror of
https://github.com/kennethreitz/pydantic.git
synced 2026-06-05 23:00:18 +00:00
e7227db41a
* starting insert prints * working exec_script * remove prints, fix exec_examples.py * more cleanup of examples, better model printing * upgrade netlify runtime * extra docs deps * few more small tweaks
14 lines
212 B
Python
14 lines
212 B
Python
from typing import ForwardRef
|
|
from pydantic import BaseModel
|
|
|
|
Foo = ForwardRef('Foo')
|
|
|
|
class Foo(BaseModel):
|
|
a: int = 123
|
|
b: Foo = None
|
|
|
|
Foo.update_forward_refs()
|
|
|
|
print(Foo())
|
|
print(Foo(b={'a': '321'}))
|