[Zope3-dev] Interface.Implements module still broken for
2.2 metaclasses
Phillip J. Eby
pje@telecommunity.com
Sun, 07 Jul 2002 21:50:48 -0400
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?
At 10:05 PM 7/7/02 +0100, Steve Alexander wrote:
>Ideally, they should, although that still doesn't deal with rolling your
>own metaclass that doesn't derive from a standard class type. I don't
>think there's a particularly elegant way to deal with that, though. yagni.
True, I don't need metaclasses that aren't derived from type. I *do* need
metaclasses that *are* derived from type, and that's *not* a YAGNI for me,
because I've been using them for some time now.
A previous version of the Interface package broke on the same thing, but I
came up with a clever descriptor-based work-around that fooled the
Interface package into doing the right thing (after a previous posting
about the problem on this list failed to produce a response). But the
Z3-to-2.6 backport of Interface appears to bypass my work-around.
>>This change would only affect proxies which happened to be around classes
>>-- and the change would simply make them *work* on such proxies once
>>isinstance() uses __class__!
>
>Indeed. But in Python2.2.x, isinstance() doesn't use __class__. Right now,
>Zope3 is being developed using Python 2.2.x.
Right, I get that. I'm using the Interface package for PEAK, with Python
2.2. I assume it benefits the cause of Zope to have the Interface package
become a Python standard. I've been working very hard to make TransWarp
and PEAK work with Interface package versions released with official
versions of Zope (e.g. 2.6 in this case), in order to keep it simple for
people to use both my code and the Interface package. But if it won't work
with even trivial metaclasses, it doesn't help very much.
At this point, I've decided to go ahead and bundle a copy of the Interface
package with PEAK so I can guarantee that people can download something
that works. :( In this case, a patched version of Interface that includes
the metaclass fix.