Hey everyone, On Wednesday, January 23, 2013 3:42:55 AM UTC-8, Jean-Yves Thibon wrote: > > > >> Yes ! As you probably already guessed, everything is not yet in a clean >> state... The first call should raise the same error than the second one. >> > > I understand, but in this case, one should teach "reversed" to use > Cardinality instead of __len__. And this is python, not sage ... > > We could do this by just implementing the __reversed__() method in (the to be deprecated) CombinatorialClass. However on the deprecation note, we will need to decide whether or not __len__() and __reversed__() should be added to the (Finite) EnumeratedSets category. Without knowing exactly how sage handles __getitem__() with sage Integers passed in (my belief is everything is converted to machine ints and uses the python list (which is an array in memory [1]) ), I feel like we should leave __len__() alone since if we are trying to create/manipulate a list longer than int (and hence the machine) can handle, you need a better data structure and storage method and __len__() should fail in the same way as trying to create/retrieve the list.
[1] http://stackoverflow.com/questions/914233/what-is-the-underlying-data-structure-for-python-lists Best, Travis -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To view this discussion on the web visit https://groups.google.com/d/msg/sage-combinat-devel/-/rXatiGt2fAoJ. 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.