-
-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
py3: use six.integer_types (step 1/2) #22871
Comments
Branch: u/chapoton/22871 |
Commit: |
New commits:
|
This comment has been minimized.
This comment has been minimized.
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
This comment has been minimized.
This comment has been minimized.
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:8
After I made the following changes, doctests passed: diff --git a/src/sage/crypto/mq/sbox.py b/src/sage/crypto/mq/sbox.py
index 2ca7a87ce4..fe83e4f36c 100644
--- a/src/sage/crypto/mq/sbox.py
+++ b/src/sage/crypto/mq/sbox.py
@@ -3,6 +3,7 @@ S-Boxes and Their Algebraic Representations
"""
from __future__ import print_function, division
from six.moves import range
+from six import integer_types
from sage.combinat.integer_vector import IntegerVectors
from sage.crypto.boolean_function import BooleanFunction
diff --git a/src/sage/monoids/free_abelian_monoid_element.py b/src/sage/monoids/free_abelian_monoid_element.py
index e04b295483..0c7d859068 100644
--- a/src/sage/monoids/free_abelian_monoid_element.py
+++ b/src/sage/monoids/free_abelian_monoid_element.py
@@ -78,7 +78,7 @@ class FreeAbelianMonoidElement(MonoidElement):
"""
MonoidElement.__init__(self, F)
n = F.ngens()
- if isinstance(x, integer_types, + (Integer,)) and x == 1:
+ if isinstance(x, integer_types + (Integer,)) and x == 1:
self._element_vector = tuple([0]*n)
elif isinstance(x, (list, tuple)):
if len(x) != n:
diff --git a/src/sage/monoids/string_monoid_element.py b/src/sage/monoids/string_monoid_element.py
index 503b56f8c0..1173827469 100644
--- a/src/sage/monoids/string_monoid_element.py
+++ b/src/sage/monoids/string_monoid_element.py
@@ -83,7 +83,7 @@ class StringMonoidElement(FreeMonoidElement):
if isinstance(x, list):
if check:
for b in x:
- if not isinstance(b, integer_types + (Intger,)):
+ if not isinstance(b, integer_types + (Integer,)):
raise TypeError(
"x (= %s) must be a list of integers." % x)
self._element_list = list(x) # make copy
diff --git a/src/sage/schemes/elliptic_curves/constructor.py b/src/sage/schemes/elliptic_curves/constructor.py
index c6375ad632..c2f38de010 100644
--- a/src/sage/schemes/elliptic_curves/constructor.py
+++ b/src/sage/schemes/elliptic_curves/constructor.py
@@ -421,7 +421,7 @@ class EllipticCurveFactory(UniqueFactory):
if R is None:
R = Sequence(x).universe()
- if R in (rings.ZZ, integer_types):
+ if R in (rings.ZZ,) + integer_types:
R = rings.QQ
return (R, tuple(R(a) for a in x)), kwds |
Changed branch from u/chapoton/22871 to u/jhpalmieri/22871 |
comment:10
Thank you. It was all hand-made, I had no time to compile sage, and I was tired.. New commits:
|
comment:11
I just found two other places needing corrections New commits:
|
Changed branch from u/jhpalmieri/22871 to u/chapoton/22871 |
Reviewer: John Pamieri |
comment:13
Okay, looks good. I haven't searched to see if this is every instance, but we can fix more on another ticket if necessary. |
comment:14
(see the sequel in #22879) |
comment:15
Thanks, John. After this and #22879, there remains at least
and
to be done later in another ticket. |
Changed branch from u/chapoton/22871 to |
Changed commit from |
Changed reviewer from John Pamieri to John Palmieri |
in some calls to isinstance (inside .py files)
part of #16072
There will remain to handle the "rings" and "modular" folders.
Also "src/sage/misc/sage_input.py" will need separate care.
CC: @tscrim @jdemeyer @a-andre @jm58660
Component: python3
Author: Frédéric Chapoton
Branch:
7b44396
Reviewer: John Palmieri
Issue created by migration from https://trac.sagemath.org/ticket/22871
The text was updated successfully, but these errors were encountered: