Skip to content

Commit

Permalink
Trac #15734: <> is not Python 3 compatible
Browse files Browse the repository at this point in the history
Replace {{{<>}}} by {{{!=}}}.

URL: http://trac.sagemath.org/15734
Reported by: aapitzsch
Ticket author(s): André Apitzsch
Reviewer(s): Jeroen Demeyer
  • Loading branch information
Release Manager authored and vbraun committed Feb 2, 2014
2 parents b989dff + 1e018de commit 77cb57c
Show file tree
Hide file tree
Showing 18 changed files with 152 additions and 154 deletions.
4 changes: 2 additions & 2 deletions src/sage/categories/crystals.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,12 +441,12 @@ def morphism(b):
# - images contains all known morphism(x)
# - known contains all elements x for which we know morphism(x)
# - todo contains all elements x for which we haven't propagated to each child
while todo <> set( [] ):
while todo != set( [] ):
x = todo.pop()
for i in index_set:
eix = getattr(x, f_string)([i for k in range(similarity_factor_domain[i])])
eigx = getattr(morphism[x], f_string)([automorphism(i) for k in range(similarity_factor[i])])
if bool(eix is None) <> bool(eigx is None):
if bool(eix is None) != bool(eigx is None):
# This is not a crystal morphism!
raise ValueError, "This is not a morphism!" #, print("x="x,"g(x)="g(x),"i="i)
if (eix is not None) and (eix not in known):
Expand Down
8 changes: 4 additions & 4 deletions src/sage/coding/code_constructions.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,13 @@ def cyclotomic_cosets(q, n, t = None):
the cosets are in ZZ/nZZ and 2 = 0 in ZZ/2ZZ.
"""
from sage.misc.misc import srange
if not(t==None) and type(t)<>Integer:
if t is not None and not isinstance(t, Integer):
raise TypeError, "Optional input %s must None or an integer."%t
if q<2 or n<2:
raise TypeError, "Inputs %s and %s must be > 1."%(q,n)
if GCD(q,n) <> 1:
if GCD(q,n) != 1:
raise TypeError, "Inputs %s and %s must be relative prime."%(q,n)
if t<>None and type(t)==Integer:
if t is not None and isinstance(t, Integer):
S = Set([t*q**i%n for i in srange(n)])
L = list(S)
L.sort()
Expand Down Expand Up @@ -302,7 +302,7 @@ def is_a_splitting(S1,S2,n):
This is a special case of Theorem 6.4.3 in [HP]_.
"""
if Set(S1).union(Set(S2)) <> Set(range(1,n)):
if Set(S1).union(Set(S2)) != Set(range(1,n)):
raise TypeError, "Lists must partition [1,2,...,n-1]."
if n<3:
raise TypeError, "Input %s must be > 2."%n
Expand Down
4 changes: 2 additions & 2 deletions src/sage/coding/linear_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -2919,9 +2919,9 @@ def standard_form(self):
for i in range(1,k+1):
r = M.rows()[i-1]
j = r.nonzero_positions()[0]
if (j < d and i <> j+1):
if j < d and i != j+1:
perm = perm *G([(i,j+1)])
if perm <> G([()]):
if perm != G([()]):
for i in range(k):
r = M.rows()[i]
A.append(perm_action(perm,r))
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/integer_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def gale_ryser_theorem(p1, p2, algorithm="gale"):

for k in range(1,n+1):
goodcols = [i for i in range(n) if s[i]==sum(A0.column(i))]
if sum(A0.column(n-k))<>s[n-k]:
if sum(A0.column(n-k)) != s[n-k]:
A0 = _slider01(A0,s[n-k],n-k, p1, p2, goodcols)

# If we need to add empty rows/columns
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/sf/monomial.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def from_polynomial(self, f, check=True):
out = self.sum_of_terms((Partition(e), c)
for (e,c) in f.dict().iteritems()
if tuple(sorted(e)) == tuple(reversed(e)))
if check and out.expand(f.parent().ngens(),f.parent().gens()) <> f:
if check and out.expand(f.parent().ngens(),f.parent().gens()) != f:
raise ValueError, "%s is not a symmetric polynomial"%f
return out

Expand Down
12 changes: 6 additions & 6 deletions src/sage/games/hexad.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,29 +535,29 @@ def find_hexad(self, pts):
if list(L2)[0] == MINIMOG[2][1]:
L1 = LL - L2
H,WHAT = self.find_hexad3(L1,MINIMOG[0][0],MINIMOG[2][1])
if H <> []:
if H != []:
return list(H),WHAT
L1 = LL - L2
H,WHAT = self.find_hexad3(L1,MINIMOG[0][2],MINIMOG[2][1])
if H <> []:
if H != []:
return list(H),WHAT
if list(L2)[0] == MINIMOG[0][0]:
L1 = (LL - L2)
H,WHAT = self.find_hexad3(L1,MINIMOG[0][0],MINIMOG[2][1])
if H <> []:
if H != []:
return list(H),WHAT
L1 = (LL - L2)
H,WHAT = self.find_hexad3(L1,MINIMOG[0][0],MINIMOG[0][2])
if H <> []:
if H != []:
return list(H),WHAT
if list(L2)[0] == MINIMOG[0][2]:
L1 = (LL - L2)
H,WHAT = self.find_hexad3(L1,MINIMOG[0][0],MINIMOG[0][2])
if H <> []:
if H != []:
return list(H),WHAT
L1 = (LL - L2)
H,WHAT = self.find_hexad3(L1,MINIMOG[2][1],MINIMOG[0][2])
if H <> []:
if H != []:
return list(H),WHAT
return list(H),WHAT
## a cross in a pic at infty
Expand Down
4 changes: 2 additions & 2 deletions src/sage/matrix/operation_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ def _name_maker(self, names):
sage: T._name_maker(['x'])
Traceback (most recent call last):
...
ValueError: list of element names must be the same size as the set, 1 <> 3
ValueError: list of element names must be the same size as the set, 1 != 3
sage: T._name_maker(['x', 'y', 4])
Traceback (most recent call last):
...
Expand Down Expand Up @@ -516,7 +516,7 @@ def _name_maker(self, names):
name_list.append(estr)
elif isinstance(names, list):
if len(names) != self._n:
raise ValueError('list of element names must be the same size as the set, %s <> %s'%(len(names), self._n))
raise ValueError('list of element names must be the same size as the set, %s != %s'%(len(names), self._n))
width = 0
for str in names:
if not isinstance(str, basestring):
Expand Down
Loading

0 comments on commit 77cb57c

Please sign in to comment.