betty.typing module¶
Providing typing utilities.
- class betty.typing.Void[source]¶
Bases:
objectA sentinel that describes the absence of a value.
Using this sentinel allows for actual values to be
None. LikeNone,Voidis only ever used through its type, and never instantiated.
- betty.typing.internal(target: _T) _T[source]¶
Mark a target as internal to Betty.
Anything decorated with
@internalMAY be used anywhere in Betty’s source code, but MUST be considered private by third-party code.This is internal. It MAY be used anywhere in Betty’s source code, but MUST NOT be used by third-party code.
- betty.typing.none_void(value: _T | type[Void]) _T | None[source]¶
Passthrough a value, but convert
betty.typing.VoidtoNone.
- betty.typing.public(target: _T) _T[source]¶
Mark a target as publicly usable.
This is intended for items nested inside something marked with
betty.typing.internal(), such as class attributes: third-party code SHOULD NOT use a class marked@internaldirectly, but MAY use any of its attributes that are marked@public.This is internal. It MAY be used anywhere in Betty’s source code, but MUST NOT be used by third-party code.