rberga06.utils.types#

Useful types.

Functions

annotated(*metadata)

A decorator that sets 'Annotated' metadata for a type.

Classes

AttrFunc(func, /)

Similar to a (str, ) -> _T function but called via attribute access instead of (...).

ItemFunc(func, /)

Similar to a (_A, ) -> _B function, but called via [...] instead of (...).

Mut(value, /)

Flexible, static, mutable strong reference to a value.

SupportsPydanticV2(*args, **kwargs)

A typing.Protocol that makes it easy to implement pydantic v2 support.

Version(version)

A pydantic v2-compatible packaging.version.Version subclass.

ref(inner, /)

Flexible, static reference (can be either a weak or a strong reference).