[Python-bugs-list] [ python-Bugs-525548 ] __add__ returning NotImplemented broken
noreply@sourceforge.net
noreply@sourceforge.net
Mon, 11 Mar 2002 05:14:48 -0800
Bugs item #525548, was opened at 2002-03-04 10:38
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=525548&group_id=5470
Category: Type/class unification
Group: Python 2.2.1 candidate
>Status: Closed
>Resolution: Duplicate
Priority: 7
Submitted By: Guido van Rossum (gvanrossum)
Assigned to: Nobody/Anonymous (nobody)
Summary: __add__ returning NotImplemented broken
Initial Comment:
A new-style class that returns NotImplemented
from its __add__ method misbehaves; this should
raise a TypeError but in fact the NotImplemented
value is kept as the return value.
This only seems to be a problem with __add__;
I bet it's because the code goes through a path
intended for sequence concatenation.
Old-style classes do the right thing.
----------------------------------------------------------------------
>Comment By: Guido van Rossum (gvanrossum)
Date: 2002-03-11 08:14
Message:
Logged In: YES
user_id=6380
Yup. Closing.
----------------------------------------------------------------------
Comment By: Michael Hudson (mwh)
Date: 2002-03-11 05:10
Message:
Logged In: YES
user_id=6656
Isn't this a dup of
[ 516727 ] MyInt(2)+"3" -> NotImplemented
? (now fixed in CVS)
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=525548&group_id=5470