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 Horacio Hoyos
Recipients Horacio Hoyos, ned.deily, ronaldoussoren
Date 2017-04-23.18:07:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1492970869.72.0.0063699562935.issue30146@psf.upfronthosting.co.za>
In-reply-to
Content
Hi, attempt 2.

My system is MacOs Yosemite (10.10.5), I have installed Python 3.6.1 downloaded from the official Python website.

I was having issues while testing a custom Set implementation using the _collections_abc base MutableSet and found that my issue was apparently resolved with issue 8743. From the fix, in the attached script I would expect the and operation between my set implementation and a string to fail with a TypeError, given that string is not an instance of Set. However, the error is not raised, i.e. the print statement is executed. 

From the discussion on issue 8743, I would expect _collections_abc.py to have a test for Set instances, but is not the case (for example):

    def __and__(self, other):
        if not isinstance(other, Iterable):
            return NotImplemented
        return self._from_iterable(value for value in other if value in self)

That is, I was expecting a isinstance(other, Set) somewhere there.

In my previous post I was told my python installation was broken. However, I checked the collections_abc.py in my windows system and is the same. I am not an expert on the Python build system, but the patch in bug 8743 applies to /Lib/_abcoll.py, but I guess _collections_abc.py is generated somehow.
History
Date User Action Args
2017-04-23 18:07:49Horacio Hoyossetrecipients: + Horacio Hoyos, ronaldoussoren, ned.deily
2017-04-23 18:07:49Horacio Hoyossetmessageid: <1492970869.72.0.0063699562935.issue30146@psf.upfronthosting.co.za>
2017-04-23 18:07:49Horacio Hoyoslinkissue30146 messages
2017-04-23 18:07:49Horacio Hoyoscreate