+
+def rename_method(newName) :
+ def doRename(m) :
+ m.__name__ = newName
+ return m
+ return doRename
+
+
+class MetaRenamer(type):
+ def __new__(mcs, name, bases, dict) :
+ for k, v in dict.items() :
+ if isinstance(v, types.FunctionType) :
+ if k != v.__name__ :
+ print 'renommage de %s en %s' % (k, v.__name__)
+ dict[v.__name__] = v
+ del dict[k]
+ return type.__new__(mcs, name, bases, dict)
+
+