If you really have a list and not just a generator, might it be worth a first pass to see if there's a 0 in the list before forming the product? With the tree structure for efficiently computing the product, you might be doing a lot of multiplication before hitting the zero item. I think that all(L) will be True if and only if L contains a zero.
John On Fri, 23 Sept 2022 at 09:11, chris wuthrich <[email protected]> wrote: > > Handling with try and check would be bad, but even in general this is an idea > that may not be what we want. For instance there are cases where the product > is interesting even if it "is zero". > > sage: x = Qp(5,10)(0) > sage: y = x.add_bigoh(5) > sage: not x, not y > (True, True) > sage: x * 5, y * 5 > (0, O(5^6)) > > Chris > > -- > You received this message because you are subscribed to the Google Groups > "sage-devel" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sage-devel/28fee9ed-e94e-4f04-8e80-c02b585cafd3n%40googlegroups.com. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/CAD0p0K7%2BD8td1pxGLy08C8R5Q0sr1PJ1ZoK%3DtiTkB41gBo_CTw%40mail.gmail.com.
