Suggestion for impriving list comprehensions

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Sun Jul 29 08:52:36 CEST 2001


Thu, 26 Jul 2001 20:53:34 -0400 (EDT), Steven D. Majewski <sdm7g at Virginia.EDU> pisze:

>>>> def every( s ):
> ...     return [ x for x in s ] 

This function can be defined easier:
    every = list

Not exactly the same I guess, but works for iterators.

-- 
 __("<  Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



More information about the Python-list mailing list