Range Operation pre-PEP

Christopher A. Craig com-nospam at ccraig.org
Wed May 16 08:19:31 EDT 2001


Greg Ewing <see at my.signature> writes:

> Tim Peters wrote:
> > 
> > For an extreme example, max(sys.stdin)
> 
> 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.
> 

Umm, you can do that now:
reduce(max, sys.stdin.read())

-- 
Christopher A. Craig <com-nospam at ccraig.org>
Love does no wrong to a neighbor; therefore love is
the fulfillment of the law - Romans 13:10



More information about the Python-list mailing list