Skip to content

bagof.magic.options

Classes

Options

Options(**kwargs)

Bases: SlotsBase

The resolved set of class-level options for a Magic class.

MetaMagic builds one Options instance per class from the keyword arguments passed to the class statement (or to the magic decorator), merged with the options inherited from base classes in MRO order -- a base class's value is used unless a derived class explicitly sets its own. The result is stored on the class as cls.__magic_options__ and, together with each field's own overrides, decides which dunder methods (__init__, __repr__, __eq__, ...) get generated and how.

See Magic for the full list of supported options and their defaults.

Methods:

make_default staticmethod
make_default() -> Self

Return a new Options instance populated with default values.