[Python-ideas] while conditional in list comprehension ?? (original) (raw)

Oscar Benjamin oscar.j.benjamin at gmail.com
Wed Jan 30 19:05:44 CET 2013


On 30 January 2013 17:56, Yuriy Taraday <yorik.sar at gmail.com> wrote:

On Wed, Jan 30, 2013 at 1:46 PM, Wolfgang Maier <wolfgang.maier at biologie.uni-freiburg.de> wrote:

your condition is 'partial(lt,50)', but this is not met to begin with and results in an empty list at least for me. Have you two actually checked the output of the code or have you just timed it? Yeah. Shame on me. You're right. My belief in partial and operator module has been shaken.

This is why I prefer this stop() idea to any of the takewhile() versions: regardless of performance it leads to clearer code, that can be understood more easily.

Oscar



More information about the Python-ideas mailing list