pg.typing.Annotated¶
Accessible via pg.typing.Annotated
.
- class Annotated(t, docstring=None, metadata=None)[source]¶
Bases:
pg.typing.Generic
The PyGlove enhanced typing.Annotated for defining a class field.
Example:
class A(pg.Object): x = pg.typing.Annotated[ int, # Field type or value spec. 'Docstring for field `x`.', # Field docstring. dict(foo=1, bar=2) # Field metadata ] ]
Attributes:
Returns the docstring for the field.
Returns the metadata for the field.
Returns the value spec for the field.