Well, for a start you cannot ask Sage to reverse the iteration order of 
anything that you can iterate on.

First example : reversed(NN)

And so there is no good solution in general unless you implement the 
reversed iterator yourself, or list all elements.

Then, instead of list(reversed(Compositions(4).list())) (which creates the 
list twice in memory plus an interator on top of it), you can do this :

C = Compositions(4).list()
C.reverse()

Then :
for c in C:
   print c

or

for i in range(len(C)):
    print C[i]

Nathann

-- 
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/-/tn3yH31mb50J.
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.

Reply via email to