In metaclass, when to use __new__ vs. __init__?

2008-05-12 Thread Matthew Wilson
I have been experimenting with metaclasses lately. It seems possible to define a metaclass by either subclassing type and then either redefining __init__ or __new__. Here's the signature for __init__: def __init__(cls, name, bases, d): and here's __new__: def __new__(meta, classname,

Re: In metaclass, when to use __new__ vs. __init__?

2008-05-12 Thread [EMAIL PROTECTED]
On 12 mai, 18:10, Matthew Wilson [EMAIL PROTECTED] wrote: I have been experimenting with metaclasses lately. It seems possible to define a metaclass by either subclassing type and then either redefining __init__ or __new__. Here's the signature for __init__: def __init__(cls, name,