mirror of
https://github.com/kennethreitz/pydantic.git
synced 2026-06-05 23:00:18 +00:00
415eb54f96
* Try to evaluate forward refs after model created * Upadate docs and remove code duplication * Update changes/2588-uriyyo.md Co-authored-by: Eric Jolibois <em.jolibois@gmail.com> * Update docs/usage/postponed_annotations.md Co-authored-by: Eric Jolibois <em.jolibois@gmail.com> * Remove unused import Co-authored-by: Eric Jolibois <em.jolibois@gmail.com>
13 lines
238 B
Python
13 lines
238 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
|
|
|
|
|
|
print(Foo())
|
|
print(Foo(sibling={'a': '321'}))
|