From: Michael Orlitzky Date: Sun, 4 Nov 2018 04:36:07 +0000 (-0400) Subject: cone/schur.py: use generator expressions where applicable. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=c41a2b88c599484041267165cf7f83fc880e4105;p=sage.d.git cone/schur.py: use generator expressions where applicable. --- diff --git a/mjo/cone/schur.py b/mjo/cone/schur.py index 3903b2b..d1bad98 100644 --- a/mjo/cone/schur.py +++ b/mjo/cone/schur.py @@ -40,9 +40,9 @@ def schur_cone(n): sage: P = schur_cone(5) sage: Q = nonnegative_orthant(5) - sage: G = [ g.change_ring(QQbar).normalized() for g in P ] - sage: H = [ h.change_ring(QQbar).normalized() for h in Q ] - sage: actual = max([arccos(u.inner_product(v)) for u in G for v in H]) + sage: G = ( g.change_ring(QQbar).normalized() for g in P ) + sage: H = ( h.change_ring(QQbar).normalized() for h in Q ) + sage: actual = max(arccos(u.inner_product(v)) for u in G for v in H) sage: expected = 3*pi/4 sage: abs(actual - expected).n() < 1e-12 True