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 ysj.ray
Recipients gvanrossum, rhettinger, stutzbach, ysj.ray
Date 2010-08-02.14:33:20
SpamBayes Score 6.89208e-05
Marked as misclassified No
Message-id <1280759602.17.0.10165000517.issue8743@psf.upfronthosting.co.za>
In-reply-to
Content
In my opinion, the set's operator should be a bit more liberal and accept any collections.Set instances. Given collections.Set is an ABC and isinstance(set, collections.Set) is True, the set methods should(strong recommended) follow all the generalized abstract semantic definition in the ABC. This according to PEP 3119:
"""
In addition, the ABCs define a minimal set of methods that establish the characteristic behavior of the type. Code that discriminates objects based on their ABC type can trust that those methods will always be present. Each of these methods are accompanied by an generalized abstract semantic definition that is described in the documentation for the ABC. These standard semantic definitions are not enforced, but are strongly recommended.
"""

The collections.Set defines __or__() as this (for example):
"""
    def __or__(self, other):
        if not isinstance(other, Iterable):
            return NotImplemented
        chain = (e for s in (self, other) for e in s)
        return self._from_iterable(chain)
"""
which means the "|" operator should accept all iterable. So I think it's better to make set's methods should be more liberal.
History
Date User Action Args
2010-08-02 14:33:23ysj.raysetrecipients: + ysj.ray, gvanrossum, rhettinger, stutzbach
2010-08-02 14:33:22ysj.raysetmessageid: <1280759602.17.0.10165000517.issue8743@psf.upfronthosting.co.za>
2010-08-02 14:33:21ysj.raylinkissue8743 messages
2010-08-02 14:33:20ysj.raycreate