Re: parameterized metaclass (or metametaclass)

2005-01-06 Thread michele . simionato
> I was wondering if there is some simpler way of building parameterized > metaclasses ? Why not just a function returning metaclasses? def metaFactory(*args): dic = return type("somemetaclass", (type,), dic) Alternatively, a metaclass classmethod returning a metaclass, so that you can use some

parameterized metaclass (or metametaclass)

2005-01-06 Thread Antoine Pitrou
Hi, I've been looking at writing parameterized metaclasses and here are the two solutions I've come to: (my goal was to build a way to automatically add a hash function that would take into account a selected list of object attributes) 1. all-in-one metametaclass: class Autohash2(type): """