graphi.compatibility.python2 module

class graphi.compatibility.python2.ABCBase

Bases: object

Helper class that provides a standard way to create an ABC using inheritance.

A helper class that has ABCMeta as its metaclass. With this class, an abstract base class can be created by simply deriving from ABC, avoiding sometimes confusing metaclass usage.

Note that the type of ABC is still ABCMeta, therefore inheriting from ABC requires the usual precautions regarding metaclass usage, as multiple inheritance may lead to metaclass conflicts.

New in version 3.4.

Changed in version 3.3: Subclasses can use register() as a Decorator.

classmethod register(subclass)

Register subclass as a “virtual subclass” of this ABC.

Changed in version 3.3: Returns the registered subclass, to allow usage as a class decorator.