Prothon, metaclasses, Zope [Was: A 'Python like' language]

Joe Mason joe at notcharles.ca
Sun Mar 28 06:54:34 EST 2004


In article <95aa1afa.0403280258.41dc5cd9 at posting.google.com>, Michele Simionato wrote:
> Joe Mason <joe at notcharles.ca> wrote in message news:<slrnc6crti.dit.joe at gate.notcharles.ca>...
>> 
>> You could just put the function call in your base class's __init__
>> method.  (Or, in fact, put the code from that call directly there, if
>> you only care when you inherit from the one Zope class.)
> 
> Uh? The base class __init__ method is not called when I derive a new
> class. I want to make the make the check at class level, *before*
> instantiating. 

It is if you call the inherited __init__ method, which you should be
doing because it probably does important stuff.

Why do you care whether it checks before instantiating the class, or
instantiates the class and then throws an error during __init__?  It's
not going to make any speed or memory difference to the successful case,
which is all you care about for performance.

Joe



More information about the Python-list mailing list