betty.typing module

Providing typing utilities.

class betty.typing.Intersection

Bases: object

A fake intersection type that works runtime, until https://github.com/astral-sh/ty/issues/2084 is fixed.

final 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__()
betty.typing.threadsafe(target: T, /) T

Mark a target as thread-safe.