A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2007-May/073275.html below:

[Python-Dev] Py2.6 buildouts to the set API

[Python-Dev] Py2.6 buildouts to the set API [Python-Dev] Py2.6 buildouts to the set APIskip at pobox.com skip at pobox.com
Sun May 20 16:16:37 CEST 2007
    >> * New method (proposed by Shane Holloway):  s1.isdisjoint(s2).   

    Mike> +1.  Disjointness verification is one of my main uses for set(),
    Mike> and though I don't think that the early-out condition would
    Mike> trigger often in my code, it would increase readability.

I think the readbility argument is marginal at best.  I use sets frequently
and to the greatest extent possible use the builtin operator support because
I find that more readable.  So for me, I'd be going from

    if not s1 & s2:

to

    if s1.isdisjoint(s2):

I'm not sure that's an improvement.

Maybe it's just me, but given two sets I frequently want to operate on
s1-s2, s2-s1 and s1&s2 in different ways.  I wouldn't find a disjoint
operation all that useful.

Skip
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4