Hi, > Together with the language-team, we decided to implement a > LazyEnumeratedSet (see my patch in the queue) which takes as input an > iterable (finite or infinite) and mimic a set which contains the > element of the iterable. It is very useful when we do not want to > implement a specific class... What do you think of it ? > > On the other hand, I'm a bit disappointed as it is not possible to > pickle an iterator and hence my new class does not pass the TestSuite. > Any idea ?
I think this is a good idea to have this feature for the casual user but that it should not be used in the code. The reason are: 1 - The set will not be picklable; 2 - The usage of tee is likely to leak a lot of memory; 3 - For programmer, I don't think it is a big save compared to subclass and implementing the Cardinality and __iter__ methods. Please have a look it some methods couldn't be lifted in the category EnumeratedSet. If you agree, as a consequence, you should add a big warning at the beginning of the file. Finally, may I suggest the alternative name EnumeratedSetFromIterator ? Cheers, Florent -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To post to this group, send email to sage-combinat-devel@googlegroups.com. To unsubscribe from this group, send email to sage-combinat-devel+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sage-combinat-devel?hl=en.