This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author dbenbenn
Recipients
Date 2007-05-19.14:03:55
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Consider the following code:

>>> class foo(set):
...     def __init__(self, iter):
...         print "foo.__init__"
...         set.__init__(self, iter)
... 
>>> x = foo([1,2])
foo.__init__
>>> y = foo([2,3])
foo.__init__
>>> x & y
foo([2])

As you can see, the foo.__and__ method creates a new foo object without calling foo.__init__.

The problem is in Objects/setobject.c:make_new_set().
History
Date User Action Args
2007-08-23 14:53:55adminlinkissue1721812 messages
2007-08-23 14:53:55admincreate