[Zope3-dev] Interface.Implements module still broken for 2.2 metaclasses

Phillip J. Eby pje@telecommunity.com
Mon, 08 Jul 2002 09:00:43 -0400


At 09:12 AM 7/8/02 +0100, Steve Alexander wrote:
>Phillip J. Eby wrote:
>>I still feel like we're not really communicating here.  As far as I can 
>>see, this is a clear and present bug, with an equally clear and present 
>>fix.  I've presented the basis of both a test case and a patch.  What am 
>>I missing?
>
>I agree with everything you've said. My only concern is that fixing the 
>Interfaces package make Zope 3 unusable with Python 2.2.

Actually, what it'll more likely do, is break backward compatibility with 
2.1.  It may be that the routines need to be conditionally defined based on 
version.  I'll try to check that out today; I still have a machine at work 
that has 2.1 on it, I think.


>If that is indeed the case, I am not in favour of applying such a fix 
>until Python 2.3 is released in some form.

Understandably.


>If it is not the case, and my concern is unfounded, then I am completely 
>in favour of the fix, and its immediate application.

The old code looks at type(), and isinstance() also looks at type().  The 
new code will simply take the "this smells like a class" branch more often; 
specifically for things which subclass TypeType or ClassType.  AFAICT, 
nothing in Zope 3 subclasses either of those types, therefore there should 
be no change in the branches taken.

When Python 2.3 isinstance() rolls around, there will be a change, in that 
proxies wrapped around a metaclass instance will give correct 
__implements__ info, where today they will not -- with or without my patch!

I'm mentioning this, not because I don't think you should test it, but to 
establish a basis for why it won't be just an accident that it works 
correctly.  :)