In Python 2, the __metaclass__ = type declaration makes declarations that would otherwise create old-style classes, instead create new-style classes. Only old-style classes use the __metaclass__ module-level declaration. New style classes inherit their metaclass from their base class (for example, object ) if __metaclass__ not provided as a class variable.
The declaration is not actually used in the code that you linked above (there are no class declarations in the __init__.py file), but it may be so. I suspect it was included as part of some template that makes Python 2 code more like Python 3 (where all classes are always new).
source share