[Python-ideas] universal set object for use in set manipulation

Terry Jones terry at jon.es
Sat Jul 25 02:09:15 CEST 2009


>>>>> "Nick" == Nick Coghlan <ncoghlan at gmail.com> writes:
Nick> Greg Ewing wrote:
>> Andy Kish wrote:
>> 
>>> It's really annoying to having appropriate identity element for
>>> union built in while missing the *correct* identity element for
>>> intersection.
>> 
>> What would
>> 
>> for x in set.universal():
>> ...
>> 
>> do?

Nick> Raise an exception, just like a signalling NaN in decimal.

Agreed. The code I stuck on PyPI today raises InfiniteSetError on __len__
and __iter__.

Nick> An expanded set concept with support for complementary set
Nick> definitions is definitely something that should cook on PyPI for a
Nick> while though.

Just to repeat the URL: http://pypi.python.org/pypi/compset/0.1

It's had exactly zero downloads :-)

Terry



More information about the Python-ideas mailing list