[Python-ideas] Integrate some itertools into the Python syntax
Chris Barker
chris.barker at noaa.gov
Tue Mar 29 18:17:09 EDT 2016
On Mon, Mar 28, 2016 at 2:46 PM, Terry Reedy <tjreedy at udel.edu> wrote:
> With the additional changes to builtins in 3.0, there has definitely been
> a shift of emphasis from lists and sequences to iterables and iterators.
>
Exactly my point -- and I think there ARE place in the language where we
could make that more obviou san natural -- maybe not this place though.
> Because of the difference between non-destructive and destructive slicing,
This is a great way to describe the difference. Note that there is also a
distinction between destructive and nondestructive looping:
for item in an_iterable:
do_something(item)
if some_condition:
break
may leave an_iterable alone, and may leave it in a different state
depending on if an_iterable is a sequence or an actual iterator.
Even so -- I agree that it's probably not a good idea to re-use the slicing
syntax for "destructive slicing."
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker at noaa.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160329/f6cdb06b/attachment.html>
More information about the Python-ideas
mailing list