[Python-bugs-list] [ python-Bugs-525548 ] __add__ returning NotImplemented broken

noreply@sourceforge.net noreply@sourceforge.net
Mon, 04 Mar 2002 07:38:50 -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: Open
Resolution: None
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.


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=525548&group_id=5470