Skip to content

Commit edb52a1

Browse files
committed
Fix pycodestyle warning E721
1 parent 26f5a09 commit edb52a1

34 files changed

+48
-48
lines changed

src/sage/algebras/hecke_algebras/cubic_hecke_base_ring.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ def normalize_names_markov(names, markov_trace_version):
5959
if markov_trace_version:
6060
names = normalize_names(4, names)
6161
else:
62-
if type(names) == tuple:
62+
if isinstance(names, tuple):
6363
names = list(names)
64-
if type(names) == list and len(names) > 3:
64+
if isinstance(names, list) and len(names) > 3:
6565
names = normalize_names(3, names[0:3])
6666
else:
6767
names = normalize_names(3, names)
@@ -641,10 +641,10 @@ def create_specialization(self, im_cubic_equation_roots, im_writhe_parameter=Non
641641
# corresponding specialized extension ring.
642642
# ----------------------------------------------------------------------
643643

644-
if type(im_cubic_equation_roots) == tuple:
644+
if isinstance(im_cubic_equation_roots, tuple):
645645
im_cubic_equation_roots = list(im_cubic_equation_roots)
646646

647-
if type(im_cubic_equation_roots) != list:
647+
if not isinstance(im_cubic_equation_roots, list):
648648
raise TypeError('cubic_equation_roots must be a list of three elements')
649649

650650
if len(im_cubic_equation_roots) != 3:
@@ -1226,10 +1226,10 @@ def create_specialization(self, im_cubic_equation_parameters, im_writhe_paramete
12261226
# ----------------------------------------------------------------------
12271227
# setting the base_ring according to the cubic_equation_parameters
12281228
# ----------------------------------------------------------------------
1229-
if type(im_cubic_equation_parameters) == tuple:
1229+
if isinstance(im_cubic_equation_parameters, tuple):
12301230
im_cubic_equation_parameters = list(im_cubic_equation_parameters)
12311231

1232-
if type(im_cubic_equation_parameters) != list:
1232+
if not isinstance(im_cubic_equation_parameters, list):
12331233
raise TypeError('cubic_equation_parameters must be a list of three elements')
12341234

12351235
if len(im_cubic_equation_parameters) != 3:

src/sage/algebras/quantum_groups/quantum_group_gap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1160,7 +1160,7 @@ def __richcmp__(self, other, op):
11601160
False
11611161
"""
11621162
if op == op_EQ:
1163-
return (type(self) == type(other)
1163+
return (type(self) is type(other)
11641164
and self.domain() is other.domain()
11651165
and self._im_gens == other._im_gens)
11661166
if op == op_NE:

src/sage/categories/pushout.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def __eq__(self, other):
202202
sage: I == I # indirect doctest
203203
True
204204
"""
205-
return type(self) == type(other)
205+
return type(self) is type(other)
206206

207207
def __ne__(self, other):
208208
"""
@@ -525,7 +525,7 @@ def __eq__(self, other):
525525
if isinstance(other, CompositeConstructionFunctor):
526526
return self.all == other.all
527527
else:
528-
return type(self) == type(other)
528+
return type(self) is type(other)
529529

530530
def __ne__(self, other):
531531
"""
@@ -677,7 +677,7 @@ def __eq__(self, other):
677677
sage: I == QQ.construction()[0]
678678
False
679679
"""
680-
c = (type(self) == type(other))
680+
c = (type(self) is type(other))
681681
if not c:
682682
if isinstance(other, IdentityFunctor_generic):
683683
return True
@@ -2986,7 +2986,7 @@ def __eq__(self, other):
29862986
"""
29872987
if not isinstance(other, QuotientFunctor):
29882988
return False
2989-
return (type(self) == type(other) and
2989+
return (type(self) is type(other) and
29902990
self.domain() == other.domain() and
29912991
self.codomain() == other.codomain() and
29922992
self.names == other.names and

src/sage/combinat/growth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,7 @@ def __eq__(self, other):
11281128
sage: G1 == G2
11291129
False
11301130
"""
1131-
return (type(self) == type(other) and
1131+
return (type(self) is type(other) and
11321132
self.rule == other.rule and
11331133
self._lambda == other._lambda and
11341134
self._mu == other._mu and

src/sage/combinat/recognizable_series.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2032,7 +2032,7 @@ def _element_constructor_(self, data,
20322032
self, Family(self.alphabet(), lambda a: Matrix()),
20332033
vector([]), vector([]))
20342034

2035-
if type(data) == self.element_class and data.parent() == self:
2035+
if isinstance(data, self.element_class) and data.parent() == self:
20362036
element = data
20372037

20382038
elif isinstance(data, RecognizableSeries):

src/sage/combinat/words/paths.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ def __eq__(self, other):
455455
sage: W1 == W3
456456
False
457457
"""
458-
return self is other or (type(self) == type(other) and
458+
return self is other or (type(self) is type(other) and
459459
self.alphabet() == other.alphabet() and
460460
self.vector_space() == other.vector_space() and
461461
self.letters_to_steps() == other.letters_to_steps())

src/sage/doctest/sources.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def __eq__(self, other):
159159
sage: FDS == FDS2
160160
True
161161
"""
162-
if type(self) != type(other):
162+
if type(self) is not type(other):
163163
return False
164164
return self.__dict__ == other.__dict__
165165

src/sage/dynamics/complex_dynamics/mandel_julia.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ def external_ray(theta, **kwds):
396396
pixel[i, j] = old_pixel[i, j]
397397

398398
# Make sure that theta is a list so loop below works
399-
if type(theta) != list:
399+
if not isinstance(theta, list):
400400
theta = [theta]
401401

402402
# Check if theta is in the interval [0,1]

src/sage/geometry/cone.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ def __richcmp__(self, right, op):
844844
sage: c2 is c3
845845
False
846846
"""
847-
if type(self) != type(right):
847+
if type(self) is not type(right):
848848
return NotImplemented
849849

850850
# We probably do need to have explicit comparison of lattices here

src/sage/geometry/relative_interior.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ def __eq__(self, other):
337337
sage: ri_segment == empty
338338
False
339339
"""
340-
if type(self) != type(other):
340+
if type(self) is not type(other):
341341
return False
342342
return self._polyhedron == other._polyhedron
343343

0 commit comments

Comments
 (0)