[Python-ideas] zip_strict() or similar in itertools ?

Wolfgang Maier wolfgang.maier at biologie.uni-freiburg.de
Thu Apr 4 14:49:18 CEST 2013


Peter Otten <__peter__ at ...> writes:

> 
> Peter Otten wrote:
> 
> >             prev = prev[:prev.index(fillvalue)]
> 
> To be bullet-proof that needs to check object identity instead of equality:
> 
> while prev[-1] is fillvalue:
>     prev = prev[:-1]
> 

That's a clever way!! Thanks, I'll try that.
Wolfgang







More information about the Python-ideas mailing list