On Mar 20, 5:52 pm, Nils Bruin <nbr...@sfu.ca> wrote: > sage: DB = CremonaDatabase() > sage: L = [ N.str()+c[0] for N in (lambda l: xrange(l[0],l[1])) > (DB.conductor_range()) for c in DB.allbsd(N).items() if > round(RDF(c[1][4]))%81 == 0] ... > - the whole lambda expression to make the pair output by > DB.conductor_range() into an iterable. Is there a syntactically more > pleasing construct in python for that? > (for instance variables local to expressions. In Magma speak: "[a..b] > where (a,b)=DB.conductor_range()")
Note that you're skipping the last conductor in the database, I think... DB.conductor_range? indicates that the returned values represent an inclusive range, but range/xrange/etc. take their second argument as an exclusive bound. (This is easy to fix with the above xrange expression, but I don't see how to fix it with the simple *args syntax.) Carl --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---