betty.typing module¶
Providing typing utilities.
- final 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.not_void(value: _T | type[Void]) TypeIs[_T][source]¶
Test that a value is not
betty.typing.Void.
- betty.typing.private(target: _T) _T[source]¶
Mark a target as private to its containing scope.
This is intended for items that cannot be marked private by prefixing their names with an underscore.
- 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.