def make_overload_attribute_template(typ, attr, overload_func, base=_OverloadAttributeTemplate):
 assert (isinstance(typ, types.Type) or issubclass(typ, types.Type))
 name = ('OverloadTemplate_%s_%s' % (typ, attr))
 dct = dict(key=typ, _attr=attr, _impl_cache={}, _overload_func=staticmethod(overload_func))
 return type(base)(name, (base,), dct)

def make_overload_attribute_template ( typ , attr , overload_func , base = _OverloadAttributeTemplate ) : assert ( isinstance ( typ , types . Type ) or issubclass ( typ , types . Type ) ) name = ( 'OverloadTemplate_%s_%s' % ( typ , attr ) ) dct = dict ( key = typ , _attr = attr , _impl_cache = { } , _overload_func = staticmethod ( overload_func ) ) return type ( base ) ( name , ( base , ) , dct )
make a template class for attribute *attr* of *typ* overloaded by *overload_func* .