- class atom.typed.ForwardTyped(resolve, args=None, kwargs=None, *, factory=None, optional=None)[source]
A Typed which delays resolving the type definition.
The first time the value is accessed or modified, the type will be resolved and the forward typed will behave identically to a normal typed.
Called to retrieve the default value.
This is called the first time the default value is retrieved for the member. It resolves the type and updates the internal default handler to behave like a normal Typed member.
- class atom.typed.Typed(kind, args=None, kwargs=None, *, factory=None, optional=None)[source]
A value which allows objects of a given type or types.
Values will be tested using the PyObject_TypeCheck C API call. This call is equivalent to type(obj) in cls.mro(). It is less flexible but can be faster than Instance. Use Instance when allowing you need a tuple of types or (abstract) types relying on custom __isinstancecheck__ and Typed when the value type is explicit.
If optional is True, the value of a Typed may be set to None, otherwise None is not considered as a valid value.