snakia.utils

Functions

frame()

Get the current frame.

inherit(type_[, attrs])

Create a new class that inherits from the given class.

nolock()

this()

Get the current function.

throw(*exceptions[, from_])

Throw an exception.

to_async(func)

Convert a sync function to an async function.

snakia.utils.frame()[source]

Get the current frame.

Return type:

FrameType

snakia.utils.inherit(type_, attrs=None, /, **kwargs)[source]

Create a new class that inherits from the given class.

Return type:

TypeVar(T, bound= type)

Args:

type_: The class to inherit from. attrs: A dictionary of attributes to add to the new class. **kwargs: Additional attributes to add to the new class.

Returns:

A new class that inherits from the given class.

snakia.utils.nolock()[source]
Return type:

None

snakia.utils.this()[source]

Get the current function.

Return type:

Any

snakia.utils.throw(*exceptions, from_=<class 'snakia.types.unique.Unset'>)[source]

Throw an exception.

Return type:

NoReturn

snakia.utils.to_async(func)[source]

Convert a sync function to an async function.

Return type:

Callable[[ParamSpec(P)], Awaitable[TypeVar(R)]]

Modules

gil_enabled