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 care for range again #22779
Labels
Milestone
Comments
Branch: u/chapoton/22779 |
New commits:
|
Commit: |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:4
These changes seem to be unnecessary in both Python 2 and 3: @@ -483,7 +484,7 @@ class SimplicialSetMorphism(Morphism):
if constant is not None:
self._constant = constant
check = False
- data = {sigma: constant.apply_degeneracies(*range(sigma.dimension()-1,-1,-1))
+ data = {sigma: constant.apply_degeneracies(*list(range(sigma.dimension()-1,-1,-1)))
for sigma in domain.nondegenerate_simplices()}
if (not isinstance(domain, SimplicialSet_arbitrary)
@@ -634,7 +635,7 @@ class SimplicialSetMorphism(Morphism):
raise ValueError('element is not a simplex in the domain')
if self.is_constant():
target = self._constant
- return target.apply_degeneracies(*range(x.dimension()-1,-1,-1))
+ return target.apply_degeneracies(*list(range(x.dimension()-1,-1,-1)))
if self._is_identity:
return x
return self._dictionary[x.nondegenerate()].apply_degeneracies(*x.degeneracies()) In both Python 2 and 3: >>> from six.moves import range # in python 2
>>> it = range(5)
>>> def foo(*args):
... print(args)
...
>>> foo(*it)
(0, 1, 2, 3, 4)
>>> it = iter([1,2,3])
>>> foo(*it)
(1, 2, 3) |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:6
thanks, undone |
comment:7
Thanks. LGTM. |
Reviewer: Travis Scrimshaw |
Changed branch from u/chapoton/22779 to |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
another step in taking care of range, towards python3
part of #16081
CC: @tscrim @jm58660 @jdemeyer
Component: python3
Author: Frédéric Chapoton
Branch/Commit:
0d3b15a
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/22779
The text was updated successfully, but these errors were encountered: