segram.utils.meta module

Metaprogramming utilities.

segram.utils.meta.get_cname(obj: Any) str[source]

Get class name.

segram.utils.meta.get_ppath(obj: Any) str[source]

Get full python path a named python object.

segram.utils.meta.init_class_attrs(cls, attrs: dict[str, str], *, check_slots: bool = True) None[source]

Initialize special class attributes if they are not already defined and set final values.

Parameters:
  • attrs – Dictionary from class special attribute names to the names of final attributes.

  • check_slots – Check if attribute names are correctly declared as slots.