betty.typing module - Betty 0.4.0a4 documentation

Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# betty.typing module

Providing typing utilities.

class betty.typing.Void

  Bases: `object`

  A sentinel that describes the absence of a value.

  Using this sentinel allows for actual values to be `None`. Like `None`, `Void` is only ever used through its type, and never instantiated.

  static __new__(cls)

betty.typing.internal(target: _T) → _T

  Mark a target as internal to Betty.

  Anything decorated with `@internal` MAY 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.public(target: _T) → _T

  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 `@internal` directly, 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.