[Interface-dev] Twisted switch progress report
Jim Fulton
jim at zope.com
Mon May 10 13:58:49 EDT 2004
Martijn Faassen wrote:
> Jim Fulton wrote:
>
>> Itamar Shtull-Trauring wrote:
>
>
>>>
>>> 3. Currently implements is indicated like this:
>>>
>>> class Bar:
>>> __implements__ = IFoo, IBar
>>>
>>> I have some code in adapter registration backwards compat layer that
>>> converts this to the correct way. The problem is with subclasses:
>>>
>>> class Sub(Bar):
>>> __implements__ = Bar.__implements__ + (ISub,)
>>>
>>> If Bar changes to implements(), Sub will break. In the interest of
>>> backwards compat, could I change the implements() class' __add__ and
>>> __radd__ to handle tuples and interface objects? With a deprecation
>>> warning of course.
>
>
> Does this affect my changes on zope.interface at all?
Hm, I guess it does.
I missread Itamar's note. I thought he was getting rid of the __implements__
usages. Hm.
> I renamed
> __implements__ to __implemented__ as it's an implementation detail, to
> avoid clashes with Zope 2.
>
> I'm also thinking about ripping out the backwards compatibility code
> which deals with public __implemented__ out.
Yes, please
Itamar,
Your fixup code should make __implements__ a descriptor that calls
implementedBy.
Jim
--
Jim Fulton mailto:jim at zope.com Python Powered!
CTO (540) 361-1714 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org
More information about the Interface-dev
mailing list