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

No. Terry> In any case, it seems to me that adding a 'universal set' to the set Terry> class does not work. On the otherhand, a separate set-complement Terry> class (which I am guessing is what you did) should work fine as far Terry> as it goes. Each instance would have normal set as its data member, Terry> and operations on complements and mixed operations would be defined Terry> in terms of operations on sets. A universal set would then be an Terry> instance with an empty set for a complement. Yes, that's all exactly what I did. I'll clean it up a little and post it somewhere, PyPI I guess. BTW, in my original posting I was wondering about this being added to Python as a generalization of the set type. After the discussion in the above thread and thinking through the various oddities it would introduce, I also concluded that would be a mistake - there's just too much that's a bit weird. Raymond is right that a strong virtue of the current set module is its simplicity. It's not worth blowing that so as to add a more general behavior that very few people will ever use. But it would be a nice 3rd party module. Terry
participants (1)
-
Terry Jones