Skip to content

Commit c5a8783

Browse files
author
Release Manager
committed
Trac #32758: fix E713 and E714 in schemes
about negative comparison using "is not" URL: https://trac.sagemath.org/32758 Reported by: chapoton Ticket author(s): Frédéric Chapoton Reviewer(s): Jonathan Kliem
2 parents 50776da + c8499d1 commit c5a8783

22 files changed

+62
-59
lines changed

build/pkgs/configure/checksums.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
tarball=configure-VERSION.tar.gz
2-
sha1=8761bf411523c8980d9e404ae9c2f5dec8b6d733
3-
md5=57bc67c3d99d2fffa8688745cc101990
4-
cksum=472330691
2+
sha1=b789b0cad7547f9b699a305d5cfe6a4b67d353df
3+
md5=ad65b7da919dcff932eb34a98793504b
4+
cksum=2565222951
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
50c7af6955632686157cd8dac2d8d764f6d41fb3
1+
dc6e96cb4344704cb6779ff68e024d06063d50ee

src/sage/schemes/affine/affine_homset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ def numerical_points(self, F=None, **kwds):
398398
from sage.schemes.affine.affine_space import is_AffineSpace
399399
if F is None:
400400
F = CC
401-
if not F in Fields() or not hasattr(F, 'precision'):
401+
if F not in Fields() or not hasattr(F, 'precision'):
402402
raise TypeError('F must be a numerical field')
403403
X = self.codomain()
404404
if X.base_ring() not in NumberFields():

src/sage/schemes/affine/affine_subscheme.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ def is_smooth(self, point=None):
328328
False
329329
"""
330330
R = self.ambient_space().coordinate_ring()
331-
if not point is None:
331+
if point is not None:
332332
self._check_satisfies_equations(point)
333333
point_subs = dict(zip(R.gens(), point))
334334
Jac = self.Jacobian().subs(point_subs)

src/sage/schemes/curves/affine_curve.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ def tangents(self, P, factor=True):
678678
# divide T by that power of vars[1]
679679
T = self.ambient_space().coordinate_ring()(dict([((v[0],v[1] - t), h) for (v,h) in T.dict().items()]))
680680
# T is homogeneous in var[0], var[1] if nonconstant, so dehomogenize
681-
if not T in self.base_ring():
681+
if T not in self.base_ring():
682682
if T.degree(vars[0]) > 0:
683683
T = T(vars[0], 1)
684684
roots = T.univariate_polynomial().roots()
@@ -982,7 +982,7 @@ def projection(self, indices, AS=None):
982982
raise ValueError("(=%s) must be a list or tuple of length between 2 and (=%s), inclusive" % (indices, n - 1))
983983
if len(set(indices)) < len(indices):
984984
raise ValueError("(=%s) must be a list or tuple of distinct indices or variables" % indices)
985-
if not AS is None:
985+
if AS is not None:
986986
if not is_AffineSpace(AS):
987987
raise TypeError("(=%s) must be an affine space" % AS)
988988
if AS.dimension_relative() != len(indices):
@@ -2145,11 +2145,11 @@ def _nonsingular_model(self):
21452145
basis = list(gbasis)
21462146
syzygy = {}
21472147
for i in range(n):
2148-
S = k[R._first_ngens(i+1)]
2148+
S = k[R._first_ngens(i + 1)]
21492149
while basis:
21502150
f = basis.pop()
21512151
if f in S:
2152-
if not i in syzygy and f:
2152+
if i not in syzygy and f:
21532153
syzygy[i] = f
21542154
else:
21552155
basis.append(f)

src/sage/schemes/curves/curve.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,8 @@ def singular_points(self, F=None):
320320
if not self.base_ring() in Fields():
321321
raise TypeError("curve must be defined over a field")
322322
F = self.base_ring()
323-
elif not F in Fields():
324-
raise TypeError("(=%s) must be a field"%F)
323+
elif F not in Fields():
324+
raise TypeError("(=%s) must be a field" % F)
325325
X = self.singular_subscheme()
326326
return [self.point(p, check=False) for p in X.rational_points(F=F)]
327327

src/sage/schemes/curves/projective_curve.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ def projection(self, P=None, PS=None):
411411
raise TypeError("this curve is already a plane curve")
412412
if self.base_ring() not in Fields():
413413
raise TypeError("this curve must be defined over a field")
414-
if not PS is None:
414+
if PS is not None:
415415
if not is_ProjectiveSpace(PS):
416416
raise TypeError("(=%s) must be a projective space" % PS)
417417
if PS.dimension_relative() != n - 1:
@@ -455,7 +455,7 @@ def projection(self, P=None, PS=None):
455455
Q = self(P)
456456
except TypeError:
457457
pass
458-
if not Q is None:
458+
if Q is not None:
459459
raise TypeError("(=%s) must be a point not on this curve" % P)
460460
try:
461461
Q = self.ambient_space()(P)

src/sage/schemes/elliptic_curves/cm.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,9 +623,8 @@ def is_cm_j_invariant(j, method='new'):
623623
True
624624
"""
625625
# First we check that j is an algebraic number:
626-
627626
from sage.rings.all import NumberFieldElement, NumberField
628-
if not isinstance(j, NumberFieldElement) and not j in QQ:
627+
if not isinstance(j, NumberFieldElement) and j not in QQ:
629628
raise NotImplementedError("is_cm_j_invariant() is only implemented for number field elements")
630629

631630
# for j in ZZ we have a lookup-table:

src/sage/schemes/elliptic_curves/ell_egros.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -447,10 +447,10 @@ def egros_get_j(S=[], proof=None, verbose=False):
447447
P = urst(P)
448448
x = P[0]
449449
y = P[1]
450-
j = x**3 /w
451-
assert j-1728 == y**2 /w
450+
j = x**3 / w
451+
assert j - 1728 == y**2 / w
452452
if is_possible_j(j, S):
453-
if not j in jlist:
453+
if j not in jlist:
454454
if verbose:
455455
print("Adding possible j = ", j)
456456
sys.stdout.flush()

src/sage/schemes/elliptic_curves/ell_modular_symbols.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def modular_symbol_space(E, sign, base_ring, bound=None):
129129
Modular Symbols space of dimension 1 for Gamma_0(11) of weight 2 with sign -1 over Finite Field of size 37
130130
131131
"""
132-
if not sign in [-1,0,1]:
132+
if sign not in [-1, 0, 1]:
133133
raise TypeError('sign must -1, 0 or 1')
134134
N = E.conductor()
135135
M = ModularSymbols(N, sign=sign, base_ring=base_ring)
@@ -323,12 +323,12 @@ def __init__(self, E, sign, nap=1000):
323323
"""
324324
from sage.libs.eclib.newforms import ECModularSymbol
325325

326-
if not sign in [-1,1]:
326+
if sign not in [-1, 1]:
327327
raise TypeError('sign must -1 or 1')
328328
self._sign = ZZ(sign)
329329
self._E = E
330330
self._scaling = 1 if E.discriminant()>0 else ZZ(1)/2
331-
self._implementation="eclib"
331+
self._implementation = "eclib"
332332
self._base_ring = QQ
333333
# The ECModularSymbol class must be initialized with sign=0 to compute minus symbols
334334
self._modsym = ECModularSymbol(E, int(sign==1), nap)
@@ -436,11 +436,11 @@ def __init__(self, E, sign, normalize="L_ratio"):
436436
[1, 1, 1, 1, 1, 1, 1, 1]
437437
438438
"""
439-
if not sign in [-1,1]:
439+
if sign not in [-1, 1]:
440440
raise TypeError('sign must -1 or 1')
441441
self._sign = ZZ(sign)
442442
self._E = E
443-
self._implementation="sage"
443+
self._implementation = "sage"
444444
self._normalize = normalize
445445
self._modsym = E.modular_symbol_space(sign=self._sign)
446446
self._base_ring = self._modsym.base_ring()

src/sage/schemes/elliptic_curves/ell_rational_field.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2376,12 +2376,12 @@ def _compute_gens(self, proof,
23762376
# progress (see trac #1949).
23772377
X = self.mwrank('-p 100 -S '+str(sat_bound))
23782378
verbose_verbose("Calling mwrank shell.")
2379-
if not 'The rank and full Mordell-Weil basis have been determined unconditionally' in X:
2379+
if 'The rank and full Mordell-Weil basis have been determined unconditionally' not in X:
23802380
msg = 'Generators not provably computed.'
23812381
if proof:
2382-
raise RuntimeError('%s\n%s'%(X,msg))
2382+
raise RuntimeError('%s\n%s' % (X, msg))
23832383
else:
2384-
verbose_verbose("Warning -- %s"%msg, level=1)
2384+
verbose_verbose("Warning -- %s" % msg, level=1)
23852385
proved = False
23862386
else:
23872387
proved = True
@@ -4714,8 +4714,9 @@ def isogenies_prime_degree(self, l=None):
47144714
if isinstance(l, list):
47154715
isogs = []
47164716
i = 0
4717-
while i<len(l):
4718-
isogenies = [f for f in self.isogenies_prime_degree(l[i]) if not f in isogs]
4717+
while i < len(l):
4718+
isogenies = [f for f in self.isogenies_prime_degree(l[i])
4719+
if f not in isogs]
47194720
isogs.extend(isogenies)
47204721
i += 1
47214722
return isogs

src/sage/schemes/elliptic_curves/isogeny_class.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ def _compute(self, verbose=False):
802802

803803
def add_tup(t):
804804
for T in [t, [t[1], t[0], t[2], 0]]:
805-
if not T in tuples:
805+
if T not in tuples:
806806
tuples.append(T)
807807
if verbose:
808808
sys.stdout.write(" -added tuple %s..." % T[:3])
@@ -818,7 +818,7 @@ def add_tup(t):
818818
sys.stdout.flush()
819819
add_tup([0,ncurves,d,phi])
820820
ncurves += 1
821-
if not d in degs:
821+
if d not in degs:
822822
degs.append(d)
823823
if verbose:
824824
sys.stdout.write("... relevant degrees: %s..." % degs)
@@ -909,8 +909,9 @@ def add_tup(t):
909909
allQs = {} # keys: discriminants d
910910
# values: lists of equivalence classes of
911911
# primitive forms of discriminant d
912-
def find_quadratic_form(d,n):
913-
if not d in allQs:
912+
913+
def find_quadratic_form(d, n):
914+
if d not in allQs:
914915
from sage.quadratic_forms.binary_qf import BinaryQF_reduced_representatives
915916

916917
allQs[d] = BinaryQF_reduced_representatives(d, primitive_only=True)

src/sage/schemes/elliptic_curves/isogeny_small_degree.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def Psi(l, use_stored=True):
188188
sage: assert Psi(7, use_stored=True) == Psi(7, use_stored=False)
189189
sage: assert Psi(13, use_stored=True) == Psi(13, use_stored=False) # not tested (very long time)
190190
"""
191-
if not l in [2, 3, 5, 7, 13]:
191+
if l not in [2, 3, 5, 7, 13]:
192192
raise ValueError("Genus zero primes are 2, 3, 5, 7 or 13.")
193193

194194
R = PolynomialRing(ZZ, 2, 'Xt')
@@ -276,7 +276,7 @@ def isogenies_prime_degree_genus_0(E, l=None, minimal_models=True):
276276
Isogeny of degree 5 from Elliptic Curve defined by y^2 + x*y + y = x^3 - x - 2 over Rational Field to Elliptic Curve defined by y^2 + x*y + y = x^3 - 76*x + 298 over Rational Field]
277277
278278
"""
279-
if not l in [2, 3, 5, 7, 13, None]:
279+
if l not in [2, 3, 5, 7, 13, None]:
280280
raise ValueError("%s is not a genus 0 prime."%l)
281281
F = E.base_ring()
282282
j = E.j_invariant()
@@ -1423,7 +1423,7 @@ def _hyperelliptic_isogeny_data(l):
14231423
ValueError: 37 must be one of [11, 17, 19, 23, 29, 31, 41, 47, 59, 71].
14241424
14251425
"""
1426-
if not l in hyperelliptic_primes:
1426+
if l not in hyperelliptic_primes:
14271427
raise ValueError("%s must be one of %s."%(l,hyperelliptic_primes))
14281428
data = {}
14291429
Zu = PolynomialRing(ZZ,'u')
@@ -1692,7 +1692,7 @@ def isogenies_prime_degree_genus_plus_0(E, l=None, minimal_models=True):
16921692
return sum([isogenies_prime_degree_genus_plus_0(E, ell, minimal_models=minimal_models)
16931693
for ell in hyperelliptic_primes],[])
16941694

1695-
if not l in hyperelliptic_primes:
1695+
if l not in hyperelliptic_primes:
16961696
raise ValueError("%s must be one of %s." % (l, hyperelliptic_primes))
16971697

16981698
F = E.base_ring()
@@ -1782,7 +1782,7 @@ def isogenies_prime_degree_genus_plus_0_j0(E, l, minimal_models=True):
17821782
sage: isogenies_prime_degree_genus_plus_0_j0(E,17)
17831783
[Isogeny of degree 17 from Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field in a of size 5^6 to Elliptic Curve defined by y^2 = x^3 + 2 over Finite Field in a of size 5^6, Isogeny of degree 17 from Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field in a of size 5^6 to Elliptic Curve defined by y^2 = x^3 + 2 over Finite Field in a of size 5^6, Isogeny of degree 17 from Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field in a of size 5^6 to Elliptic Curve defined by y^2 = x^3 + 2 over Finite Field in a of size 5^6, Isogeny of degree 17 from Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field in a of size 5^6 to Elliptic Curve defined by y^2 = x^3 + 2 over Finite Field in a of size 5^6, Isogeny of degree 17 from Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field in a of size 5^6 to Elliptic Curve defined by y^2 = x^3 + 2 over Finite Field in a of size 5^6, Isogeny of degree 17 from Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field in a of size 5^6 to Elliptic Curve defined by y^2 = x^3 + 2 over Finite Field in a of size 5^6, Isogeny of degree 17 from Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field in a of size 5^6 to Elliptic Curve defined by y^2 = x^3 + 2 over Finite Field in a of size 5^6, Isogeny of degree 17 from Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field in a of size 5^6 to Elliptic Curve defined by y^2 = x^3 + 2 over Finite Field in a of size 5^6, Isogeny of degree 17 from Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field in a of size 5^6 to Elliptic Curve defined by y^2 = x^3 + 2 over Finite Field in a of size 5^6, Isogeny of degree 17 from Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field in a of size 5^6 to Elliptic Curve defined by y^2 = x^3 + 2 over Finite Field in a of size 5^6, Isogeny of degree 17 from Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field in a of size 5^6 to Elliptic Curve defined by y^2 = x^3 + 2 over Finite Field in a of size 5^6, Isogeny of degree 17 from Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field in a of size 5^6 to Elliptic Curve defined by y^2 = x^3 + 2 over Finite Field in a of size 5^6, Isogeny of degree 17 from Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field in a of size 5^6 to Elliptic Curve defined by y^2 = x^3 + 2 over Finite Field in a of size 5^6, Isogeny of degree 17 from Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field in a of size 5^6 to Elliptic Curve defined by y^2 = x^3 + 2 over Finite Field in a of size 5^6, Isogeny of degree 17 from Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field in a of size 5^6 to Elliptic Curve defined by y^2 = x^3 + 2 over Finite Field in a of size 5^6, Isogeny of degree 17 from Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field in a of size 5^6 to Elliptic Curve defined by y^2 = x^3 + 2 over Finite Field in a of size 5^6, Isogeny of degree 17 from Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field in a of size 5^6 to Elliptic Curve defined by y^2 = x^3 + 2 over Finite Field in a of size 5^6, Isogeny of degree 17 from Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field in a of size 5^6 to Elliptic Curve defined by y^2 = x^3 + 2 over Finite Field in a of size 5^6]
17841784
"""
1785-
if not l in hyperelliptic_primes:
1785+
if l not in hyperelliptic_primes:
17861786
raise ValueError("%s must be one of %s."%(l,hyperelliptic_primes))
17871787
F = E.base_field()
17881788
if E.j_invariant() != 0:
@@ -1873,7 +1873,7 @@ def isogenies_prime_degree_genus_plus_0_j1728(E, l, minimal_models=True):
18731873
sage: [(p,len(isogenies_prime_degree_genus_plus_0_j1728(Emin,p))) for p in [17, 29, 41]]
18741874
[(17, 2), (29, 2), (41, 2)]
18751875
"""
1876-
if not l in hyperelliptic_primes:
1876+
if l not in hyperelliptic_primes:
18771877
raise ValueError("%s must be one of %s."%(l,hyperelliptic_primes))
18781878
F = E.base_ring()
18791879
if E.j_invariant() != 1728:
@@ -2352,10 +2352,10 @@ def isogenies_prime_degree(E, l, minimal_models=True):
23522352
if l==p:
23532353
return isogenies_prime_degree_general(E,l, minimal_models=minimal_models)
23542354

2355-
if l in [5,7,13] and not p in [2,3]:
2355+
if l in [5,7,13] and p not in [2,3]:
23562356
return isogenies_prime_degree_genus_0(E,l, minimal_models=minimal_models)
23572357

2358-
if l in hyperelliptic_primes and not p in [2,3]:
2358+
if l in hyperelliptic_primes and p not in [2,3]:
23592359
return isogenies_prime_degree_genus_plus_0(E,l, minimal_models=minimal_models)
23602360

23612361
j = E.j_invariant()

src/sage/schemes/elliptic_curves/kraus.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ def check_Kraus_global(c4, c6, assume_nonsingular=False, debug=False):
809809
a1list = [d[1] for d in dat]
810810
a1 = K.solve_CRT(a1list,P2list, check=True)
811811
# See comment below: this is needed for when we combine with the primes above 3.
812-
if not a1 in three: # three.divides(a1) causes a segfault
812+
if a1 not in three: # three.divides(a1) causes a segfault
813813
a1 = 3*a1
814814

815815
# Using this a1, recompute the local a3's:

src/sage/schemes/generic/scheme.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -866,11 +866,11 @@ def __init__(self, R, S=None, category=None):
866866
<class 'sage.schemes.generic.scheme.AffineScheme_with_category'>
867867
"""
868868
from sage.categories.commutative_rings import CommutativeRings
869-
if not R in CommutativeRings():
869+
if R not in CommutativeRings():
870870
raise TypeError("R (={}) must be a commutative ring".format(R))
871871
self.__R = R
872-
if not S is None:
873-
if not S in CommutativeRings():
872+
if S is not None:
873+
if S not in CommutativeRings():
874874
raise TypeError("S (={}) must be a commutative ring".format(S))
875875
if not R.has_coerce_map_from(S):
876876
raise ValueError("There must be a natural map S --> R, but S = {} and R = {}".format(S, R))

src/sage/schemes/plane_conics/con_field.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ def parametrization(self, point=None, morphism=True):
878878
...
879879
ValueError: The conic self (=Projective Conic Curve over Rational Field defined by x^2 + y^2) is not smooth, hence does not have a parametrization.
880880
"""
881-
if (not self._parametrization is None) and not point:
881+
if (self._parametrization is not None) and not point:
882882
par = self._parametrization
883883
else:
884884
if not self.is_smooth():

src/sage/schemes/plane_quartics/quartic_constructor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ def QuarticCurve(F, PP=None, check=False):
5858
if not(F.is_homogeneous() and F.degree()==4):
5959
raise ValueError("Argument F (=%s) must be a homogeneous polynomial of degree 4"%F)
6060

61-
if not PP is None:
61+
if PP is not None:
6262
if not is_ProjectiveSpace(PP) and PP.dimension == 2:
63-
raise ValueError("Argument PP (=%s) must be a projective plane"%PP)
63+
raise ValueError(f"Argument PP (={PP}) must be a projective plane")
6464
else:
6565
PP = ProjectiveSpace(P)
6666

src/sage/schemes/projective/projective_homset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ def numerical_points(self, F=None, **kwds):
373373
from sage.schemes.projective.projective_space import is_ProjectiveSpace
374374
if F is None:
375375
F = CC
376-
if not F in Fields() or not hasattr(F, 'precision'):
376+
if F not in Fields() or not hasattr(F, 'precision'):
377377
raise TypeError('F must be a numerical field')
378378
X = self.codomain()
379379
if X.base_ring() not in NumberFields():

src/sage/schemes/projective/projective_morphism.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1594,18 +1594,20 @@ def rational_preimages(self, Q, k=1):
15941594
k = ZZ(k)
15951595
if k <= 0:
15961596
raise ValueError("k (=%s) must be a positive integer" % k)
1597-
#first check if subscheme
1597+
# first check if subscheme
15981598
from sage.schemes.projective.projective_subscheme import AlgebraicScheme_subscheme_projective
15991599
if isinstance(Q, AlgebraicScheme_subscheme_projective):
16001600
return Q.preimage(self, k)
16011601

1602-
#else assume a point
1602+
# else assume a point
16031603
BR = self.base_ring()
16041604
if k > 1 and not self.is_endomorphism():
16051605
raise TypeError("must be an endomorphism of projective space")
1606-
if not Q in self.codomain():
1606+
if Q not in self.codomain():
16071607
raise TypeError("point must be in codomain of self")
1608-
if isinstance(BR.base_ring(),(ComplexField_class, RealField_class,RealIntervalField_class, ComplexIntervalField_class)):
1608+
if isinstance(BR.base_ring(), (ComplexField_class, RealField_class,
1609+
RealIntervalField_class,
1610+
ComplexIntervalField_class)):
16091611
raise NotImplementedError("not implemented over precision fields")
16101612
PS = self.domain().ambient_space()
16111613
N = PS.dimension_relative()

src/sage/schemes/projective/projective_subscheme.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ def is_smooth(self, point=None):
434434
sage: H.is_smooth() # one of the few cases where the cone over the subvariety is smooth
435435
True
436436
"""
437-
if not point is None:
437+
if point is not None:
438438
self._check_satisfies_equations(point)
439439
R = self.ambient_space().coordinate_ring()
440440
point_subs = dict(zip(R.gens(), point))

src/sage/schemes/toric/homset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ def _finite_field_enumerator(self, finite_field=None):
400400
variety = self.codomain()
401401
if finite_field is None:
402402
finite_field = variety.base_ring()
403-
if not finite_field in FiniteFields():
403+
if finite_field not in FiniteFields():
404404
raise ValueError('not a finite field')
405405
return FiniteFieldPointEnumerator(variety.fan(), finite_field)
406406

0 commit comments

Comments
 (0)