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 rhettinger
Recipients docs@python, ezio.melotti, hhm, pconnell, rhettinger
Date 2013-05-27.07:59:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1369641568.61.0.0872321476433.issue18032@psf.upfronthosting.co.za>
In-reply-to
Content
We don't normally document implementation details or the presences or absence of internal optimizations.  This gives us freedom to change the implementation and it allows freedom for other implementations (such as Jython, IronPython, and PyPy) to make their own choices.  Often those implementations start out with the simplest correct approach and then become increasingly optimized over time. 

I'm leaving this one open as a possible CPythhon performance enhancement, adding early-out behavior to issubset() when the argument is a non-set, non-dict iterable:

    def issubset(self, iterable):
        n = len(self)
        seen = set() 
        for x in iterable:
            if x not in seen and x in self:
                seen.add(x)
                n -= 1
                if not n:
                    return True             # early-out
        return False
History
Date User Action Args
2013-05-27 07:59:28rhettingersetrecipients: + rhettinger, ezio.melotti, docs@python, hhm, pconnell
2013-05-27 07:59:28rhettingersetmessageid: <1369641568.61.0.0872321476433.issue18032@psf.upfronthosting.co.za>
2013-05-27 07:59:28rhettingerlinkissue18032 messages
2013-05-27 07:59:28rhettingercreate