Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
18119: moved itertools imports inside methods
Browse files Browse the repository at this point in the history
  • Loading branch information
seblabbe committed Apr 8, 2021
1 parent 9d5b3c0 commit 6dcef98
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/sage/combinat/words/morphism.py
Expand Up @@ -89,8 +89,7 @@
# https://www.gnu.org/licenses/
# ****************************************************************************

from collections import Counter
from itertools import chain, count
from itertools import chain

from sage.misc.callable_dict import CallableDict
from sage.structure.sage_object import SageObject
Expand Down Expand Up @@ -3412,6 +3411,8 @@ def infinite_repetitions_bounded(self, w=None):
sage: sorted(m.infinite_repetitions_bounded())
[word: c, word: d]
"""
from itertools import count

def impl():
U = {}
for x in unbounded:
Expand Down Expand Up @@ -3497,6 +3498,8 @@ def infinite_repetitions_growing(self, w=None):
sage: sorted(m.infinite_repetitions_growing())
[word: bc]
"""
from collections import Counter

if w is None:
w = self._morph
f = self.restrict_domain(self.reach(w))
Expand Down Expand Up @@ -3764,6 +3767,7 @@ def simplify_injective(self):
return self, self, self.domain().identity_morphism(), 0
g = h * k

from itertools import count
for i in count(start=1):
try:
h_new, k_new = g.simplify()
Expand Down

0 comments on commit 6dcef98

Please sign in to comment.