PEP 276 Simple Iterator for ints
Chris Barker
chrishbarker at home.net
Thu Nov 15 18:48:12 EST 2001
Skip Montanaro wrote:
> I liked "for i in 10:" at first, however, the more I see of the Haskell
> iterator syntax, the more I like it. Given that
>
> * it should cause no backward compatibility issues (you can't put "..."
> in a list now, can you? NumPy?)
If this is what you mean, yes, you can:
>>> from Numeric import *
>>> a = ones((3,3,3),Int)
>>> for i in a[1,...,2]:
... print i
...
1
1
1
>>>
--
Christopher Barker,
Ph.D.
ChrisHBarker at home.net --- --- ---
http://members.home.net/barkerlohmann ---@@ -----@@ -----@@
------@@@ ------@@@ ------@@@
Oil Spill Modeling ------ @ ------ @ ------ @
Water Resources Engineering ------- --------- --------
Coastal and Fluvial Hydrodynamics --------------------------------------
------------------------------------------------------------------------
More information about the Python-list
mailing list