tyro._singleton¶
Module Contents¶
- tyro._singleton.SubclassableAny¶
- class tyro._singleton.PropagatingMissingType[source]¶
Bases:
Singleton,typing_extensions.AnyType for the
tyro.MISSINGsingleton.
- class tyro._singleton.NonpropagatingMissingType[source]¶
Bases:
Singleton,typing_extensions.AnyType for the
tyro.MISSING_NONPROPsingleton.
- tyro._singleton.MISSING: Any¶
Sentinel value to mark default values as missing. Can be used to mark fields passed in via default= for tyro.cli() as required.
When used, the ‘missing’ semantics propagate to children. For example, if we write:
def main(inner: Dataclass = tyro.MISSING) -> None: ... tyro.cli(main)
then all fields belonging to
Dataclasswill be marked as missing, even if a default exists in the dataclass definition.
- tyro._singleton.MISSING_NONPROP: Any¶
Non-propagating version of
tyro.MISSING.When used, the ‘missing’ semantics do not propagate to children. For example:
def main(inner: Dataclass = tyro.MISSING_NONPROP) -> None: ... tyro.cli(main)
is equivalent to:
def main(inner: Dataclass) -> None: ... tyro.cli(main)
where default values for fields belonging to
Dataclasswill be taken from the dataclass definition.
- tyro._singleton.MISSING_AND_MISSING_NONPROP = ()¶
Singletons that are considered missing values when generating CLI interfaces.
- tyro._singleton.EXCLUDE_FROM_CALL¶
Singleton indicating that an argument should not be passed into a field constructor. This is used for
typing.TypedDict.
- tyro._singleton.DEFAULT_SENTINEL_SINGLETONS¶
Singletons that are used as default sentinels when generating CLI interfaces.