Skip to content

Commit 32e6b77

Browse files
committed
cleanup old, unreadable dict creations
1 parent 37a1b2a commit 32e6b77

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/sage/combinat/recognizable_series.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ def immutable(m):
456456
return m
457457

458458
if isinstance(mu, dict):
459-
mu = dict((a, immutable(M)) for a, M in mu.items())
459+
mu = {a: immutable(M) for a, M in mu.items()}
460460
mu = Family(mu)
461461

462462
if not mu.is_finite():
@@ -1284,7 +1284,7 @@ def _add_(self, other):
12841284

12851285
result = P.element_class(
12861286
P,
1287-
dict((a, self.mu[a].block_sum(other.mu[a])) for a in P.alphabet()),
1287+
{a: self.mu[a].block_sum(other.mu[a]) for a in P.alphabet()},
12881288
vector(tuple(self.left) + tuple(other.left)),
12891289
vector(tuple(self.right) + tuple(other.right)))
12901290

@@ -1541,8 +1541,7 @@ def tensor_product(left, right):
15411541
return T
15421542
result = P.element_class(
15431543
P,
1544-
dict((a, tensor_product(self.mu[a], other.mu[a]))
1545-
for a in P.alphabet()),
1544+
{a: tensor_product(self.mu[a], other.mu[a]) for a in P.alphabet()},
15461545
vector(tensor_product(Matrix(self.left), Matrix(other.left))),
15471546
vector(tensor_product(Matrix(self.right), Matrix(other.right))))
15481547

@@ -2012,7 +2011,7 @@ def one_hadamard(self):
20122011
from sage.modules.free_module_element import vector
20132012

20142013
one = self.coefficient_ring()(1)
2015-
return self(dict((a, Matrix([[one]])) for a in self.alphabet()),
2014+
return self({a: Matrix([[one]]) for a in self.alphabet()},
20162015
vector([one]), vector([one]))
20172016

20182017
def _element_constructor_(self, data,

0 commit comments

Comments
 (0)