On Tue, Jan 8, 2019 at 12:26 PM Tim Chase <python.l...@tim.thechases.com> wrote:
>   def all_equal(iterable):
>     i = iter(iterable)
>     first = next(i)
>     return all(x == first for x in i)
>
> And I even like how nicely it reads :-)

Yes, there's something beautiful about writing "first = next" :-)

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to