Files
pydantic/docs/examples/postponed_annotations_self_referencing_annotations.py
T
Samuel Colvin 17b5ff42c1 renaming docs examples (#972)
* renaming docs examples

* tweaks
2019-11-07 14:40:44 +00:00

13 lines
263 B
Python

from __future__ import annotations
from pydantic import BaseModel
class Foo(BaseModel):
a: int = 123
#: The sibling of `Foo` is referenced directly by type
sibling: Foo = None
Foo.update_forward_refs()
print(Foo())
print(Foo(sibling={'a': '321'}))