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

Commit a63248e

Browse files
author
Frédéric Chapoton
committed
use from six.moves.builtins, details of imports
1 parent 0cbd8e2 commit a63248e

File tree

4 files changed

+27
-27
lines changed

4 files changed

+27
-27
lines changed

src/sage/combinat/integer_vector.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
from __future__ import print_function, absolute_import
3030

3131
import itertools
32-
import misc
33-
from six.moves.builtin import list as builtinlist
32+
from . import misc
33+
from six.moves.builtins import list as builtinlist
3434
from sage.categories.enumerated_sets import EnumeratedSets
3535
from sage.combinat.combinat import CombinatorialClass
3636
from sage.rings.integer import Integer

src/sage/combinat/integer_vector_weighted.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
from sage.structure.parent import Parent
3232
from sage.sets.disjoint_union_enumerated_sets import DisjointUnionEnumeratedSets
3333
from sage.combinat.words.word import Word
34-
from permutation import Permutation
34+
from .permutation import Permutation
3535

3636
def WeightedIntegerVectors(n = None, weight = None):
3737
"""

src/sage/combinat/root_system/cartan_type.py

+23-23
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ def __call__(self, *args):
634634

635635
if isinstance(t, str):
636636
if "x" in t:
637-
import type_reducible
637+
from . import type_reducible
638638
return type_reducible.CartanType([CartanType(u) for u in t.split("x")])
639639
elif t[-1] == "*":
640640
return CartanType(t[:-1]).dual()
@@ -650,35 +650,35 @@ def __call__(self, *args):
650650
if len(t) == 2:
651651
if letter == "A":
652652
if n >= 0:
653-
import type_A
653+
from . import type_A
654654
return type_A.CartanType(n)
655655
if letter == "B":
656656
if n >= 1:
657-
import type_B
657+
from . import type_B
658658
return type_B.CartanType(n)
659659
if letter == "C":
660660
if n >= 1:
661-
import type_C
661+
from . import type_C
662662
return type_C.CartanType(n)
663663
if letter == "D":
664-
import type_D
664+
from . import type_D
665665
if n >= 2:
666666
return type_D.CartanType(n)
667667
if letter == "E":
668668
if n >= 6 and n <= 8:
669-
import type_E
669+
from . import type_E
670670
return type_E.CartanType(n)
671671
if letter == "F":
672672
if n == 4:
673-
import type_F
673+
from . import type_F
674674
return type_F.CartanType()
675675
if letter == "G":
676676
if n == 2:
677-
import type_G
677+
from . import type_G
678678
return type_G.CartanType()
679679
if letter == "H":
680680
if n in [3, 4]:
681-
import type_H
681+
from . import type_H
682682
return type_H.CartanType(n)
683683
if letter == "I":
684684
if n == 1:
@@ -690,42 +690,42 @@ def __call__(self, *args):
690690
if n == 6:
691691
return CartanType(["G", 2])
692692
if n >= 1:
693-
import type_I
693+
from . import type_I
694694
return type_I.CartanType(n)
695695
if len(t) == 3:
696696
if t[2] == 1: # Untwisted affine
697697
if letter == "A":
698698
if n >= 1:
699-
import type_A_affine
699+
from . import type_A_affine
700700
return type_A_affine.CartanType(n)
701701
if letter == "B":
702702
if n >= 1:
703-
import type_B_affine
703+
from . import type_B_affine
704704
return type_B_affine.CartanType(n)
705705
if letter == "C":
706706
if n >= 1:
707-
import type_C_affine
707+
from . import type_C_affine
708708
return type_C_affine.CartanType(n)
709709
if letter == "D":
710-
import type_D_affine
710+
from . import type_D_affine
711711
if n >= 3:
712712
return type_D_affine.CartanType(n)
713713
if letter == "E":
714714
if n >= 6 and n <= 8:
715-
import type_E_affine
715+
from . import type_E_affine
716716
return type_E_affine.CartanType(n)
717717
if letter == "F":
718718
if n == 4:
719-
import type_F_affine
719+
from . import type_F_affine
720720
return type_F_affine.CartanType()
721721
if letter == "G":
722722
if n == 2:
723-
import type_G_affine
723+
from . import type_G_affine
724724
return type_G_affine.CartanType()
725725
if t[2] in [2,3]:
726726
if letter == "BC" and t[2] == 2:
727727
if n >= 1:
728-
import type_BC_affine
728+
from . import type_BC_affine
729729
return type_BC_affine.CartanType(n)
730730
if letter == "A" and t[2] == 2:
731731
if n%2 == 0: # Kac' A_2n^(2)
@@ -739,7 +739,7 @@ def __call__(self, *args):
739739
if letter == "E" and t[2] == 2 and n == 6:
740740
return CartanType(["F", 4, 1]).dual()
741741
raise ValueError("%s is not a valid Cartan type"%t)
742-
import type_reducible
742+
from . import type_reducible
743743
return type_reducible.CartanType([ CartanType(subtype) for subtype in t ])
744744

745745
global_options = CartanTypeOptions
@@ -1128,7 +1128,7 @@ def dual(self):
11281128
sage: CartanType(['F',4]).dual()
11291129
['F', 4] relabelled by {1: 4, 2: 3, 3: 2, 4: 1}
11301130
"""
1131-
import type_dual
1131+
from . import type_dual
11321132
return type_dual.CartanType(self)
11331133

11341134
def relabel(self, relabelling):
@@ -1153,7 +1153,7 @@ def relabel(self, relabelling):
11531153
4 3 2 1
11541154
F4 relabelled by {1: 4, 2: 3, 3: 2, 4: 1}
11551155
"""
1156-
import type_relabel
1156+
from . import type_relabel
11571157
return type_relabel.CartanType(self, relabelling)
11581158

11591159
def subtype(self, index_set):
@@ -1192,7 +1192,7 @@ def marked_nodes(self, marked_nodes):
11921192
"""
11931193
if not marked_nodes:
11941194
return self
1195-
import type_marked
1195+
from . import type_marked
11961196
return type_marked.CartanType(self, marked_nodes)
11971197

11981198
def is_reducible(self):
@@ -2403,7 +2403,7 @@ def __reduce__(self):
24032403
True
24042404
24052405
"""
2406-
from cartan_type import CartanType
2406+
from .cartan_type import CartanType
24072407
return (CartanType, (self.letter, self.n))
24082408

24092409
def __cmp__(self, other):

src/sage/structure/global_options.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ def _ge_option_b(self, other):
371371
#*****************************************************************************
372372
from __future__ import absolute_import
373373

374-
from six.moves.builtin import str
374+
from six.moves.builtins import str
375375
from sage.structure.sage_object import SageObject
376376

377377

0 commit comments

Comments
 (0)