Navigation

Quick search

Source code for sqlobject.compat

[docs]defwith_metaclass(meta,*bases):"""Create a base class with a metaclass."""# This requires a bit of explanation: the basic idea is to make a dummy# metaclass for one level of class instantiation that replaces itself with# the actual metaclass.classmetaclass(meta):def__new__(cls,name,this_bases,d):returnmeta(name,bases,d)returntype.__new__(metaclass,'temporary_class',(),{})