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

skip 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:


    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.


More information about the Python-Dev mailing list