Skip to content

Commit

Permalink
python3.11: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jasha10 committed Nov 16, 2022
1 parent 540d58c commit 5fbfedc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/source/structured_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,10 @@ Structured configs can be nested.
... class Group:
... name: str = MISSING
... # data classes can be nested
... admin: User = User()
... admin: User = field(default_factory=User)
...
... # You can also specify different defaults for nested classes
... manager: User = User(name="manager", height=Height.TALL)
... manager: User = field(default_factory=lambda: User(name="manager", height=Height.TALL))

>>> conf: Group = OmegaConf.structured(Group)
>>> print(OmegaConf.to_yaml(conf))
Expand Down Expand Up @@ -585,8 +585,8 @@ A Schema for the above config can be defined like this.

>>> @dataclass
... class MyConfig:
... server: Server = Server()
... log: Log = Log()
... server: Server = field(default_factory=Server)
... log: Log = field(default_factory=Log)
... users: List[int] = field(default_factory=list)


Expand Down

0 comments on commit 5fbfedc

Please sign in to comment.