Range Operation pre-PEP

Tim Peters tim.one at home.com
Wed May 16 02:33:44 EDT 2001


[Tim, on 2.2's use of iterators]
> For an extreme example, max(sys.stdin)

[Greg Ewing]
> Ha! I like it! I can just imagine a professor setting
> an assignment which says "Read characters from standard
> input up to EOF and return the one with the highest
> ASCII value" and some smart-alec student hands in
> a one-line Python solution.

Never!  They still have to import sys, and semicolons are bad style <wink>.

> Pretty soon our one-liners will be even shorter
> than Perl's!
>
> Next-stop-APL-ly,

Iterators aren't a sure thing for 2.2, just more likely than not at this
point.  Everyone who has tried them appears to like them a lot, and the
implementation seemed rock solid from the first checkin (still waiting for
the first bug to pop up!).  Backward compatibility is 100%, the
implementation of loops is simpler and faster, and it's a protocol that
applies without needing any changes to NeilS's work on generators too.

So you'd think nothing could stop it.  Guido is still cautious, though,
precisely because he doesn't want Python to move in an APLish direction.  So
while I think it's way cool too, I never say that out loud <wink>.

well-ok-i-do-but-i-try-to-look-concered-at-the-same-time-ly y'rs  - tim





More information about the Python-list mailing list