A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-June/036595.html below:

[Python-Dev] Bug with ExtensionClass and __coerce__

[Python-Dev] Bug with ExtensionClass and __coerce__ [Python-Dev] Bug with ExtensionClass and __coerce__Christian Reis kiko@async.com.br
Sat, 28 Jun 2003 14:53:46 -0300
In the next chapter of the war for Persistent.__cmp__, I found a bug in
ExtensionClass's handling of __coerce__. Here's a paired-down testcase.

    from ExtensionClass import Base

    class Foo(Base):
        def __coerce__(self, other): return None

    class Bar(Base):
        def __coerce__(self, other): return NotImplemented

    f = Foo(); assert 0 < f

        -> SystemError: error return without exception set

    b = Bar(); assert 0 < b

        -> SystemError: new style getargs format but argument is not a tuple

As far as I know (and the PSL docs say) these are the only valid ways to
give up __coerce__. Guido has in the past provided a hint to the latter
error:

http://mail.zope.org/pipermail/zope-coders/2002-January/000594.html

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4