baybe.utils.basicΒΆ

Collection of small basic utilities.

Functions

find_subclass(base, name_or_abbr, /)

Retrieve a specific subclass of a base class via its name or abbreviation.

get_baseclasses(cls[, recursive, abstract])

Return a list of base classes for the given class.

get_subclasses(cls[, recursive, abstract])

Return a list of subclasses for the given class.

group_duplicate_values(dictionary)

Identify groups of keys that have the same value.

hilberts_factory(factory)

Provide an infinite stream of the factory's products.

match_attributes(object, callable_, /[, ...])

Find the attributes of an object that match with a given callable signature.

refers_to(cls, name_or_abbr, /)

Check if the given name or abbreviation refers to the specified class.

register_hooks(target[, pre_hooks, post_hooks])

Register custom hooks with a given target callable.

to_tuple(x)

Convert any sequence into a tuple.

Classes

Dummy

Placeholder element for array-like data types.

classproperty

A decorator to make class properties.