Re: [Python-Dev] __metaclass__ problem

2005-03-18 Thread Nick Coghlan
Phillip J. Eby wrote: At 10:11 AM 3/19/05 +1000, Nick Coghlan wrote: 'Meta1' is NOT a subclass of 'Meta2', yet the exception is not thrown. Instead, the explicitly requested metaclass has been silently replaced with a subclass. I think the OP is justified in calling that 'suprising'. This is pre

Re: [Python-Dev] __metaclass__ problem

2005-03-18 Thread Phillip J. Eby
At 10:11 AM 3/19/05 +1000, Nick Coghlan wrote: Nick Coghlan wrote: If you are not getting an exception when breaking this rule, my guess would be that your metaclasses are not inheriting from 'type', or else are not invoking type's __new__ method. The logic to trigger the exception lives in type

Re: [Python-Dev] __metaclass__ problem

2005-03-18 Thread Nick Coghlan
Nick Coghlan wrote: If you are not getting an exception when breaking this rule, my guess would be that your metaclasses are not inheriting from 'type', or else are not invoking type's __new__ method. The logic to trigger the exception lives in type's __new__ method - if that doesn't get invoked

Re: [Python-Dev] __metaclass__ problem

2005-03-18 Thread Nick Coghlan
Dirk Brenckmann wrote: In consequence a programmer only is in control of the "metaclass" of his class, if he decides it to be a subtype of all former metaclasses he used in his class hierarchy, or if he uses the same metaclass as the superclass does. The behaviour is intentional, but you are correc

[Python-Dev] __metaclass__ problem

2005-03-18 Thread Dirk Brenckmann
Hi there, first of all I'd like to introduce myself, because I'm new to this list. If I did wrong to post here, please be patient... The reason for my posting is my previous work with __metaclass__ and advice.py, which is nice to use. While working with __metaclass__ I found situations, where I c