[prev in list] [next in list] [prev in thread] [next in thread]
List: python-dev
Subject: Re: [Python-Dev] Py2.6 buildouts to the set API
From: skip () pobox ! com
Date: 2007-05-20 14:16:37
Message-ID: 18000.22597.5993.854803 () montanaro ! dyndns ! org
[Download RAW message or body]
>> * 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
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-dev%40progressive-comp.com
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic