Closed fchapoton closed 7 years ago
Branch: u/chapoton/22779
Branch pushed to git repo; I updated commit sha1. New commits:
bd4921e | trac 22779 one more fix for range |
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:
0d3b15a | trac 22779 undo change in simplicial set morphism |
thanks, undone
Thanks. LGTM.
Reviewer: Travis Scrimshaw
Changed branch from u/chapoton/22779 to 0d3b15a
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