Language design

Neil Cerutti neilc at norwich.edu
Wed Sep 11 10:32:57 EDT 2013


On 2013-09-11, Burak Arslan <burak.arslan at arskom.com.tr> wrote:
> On 09/10/13 09:09, Steven D'Aprano wrote:
>> What design mistakes, traps or gotchas do you think Python has? 
>
> My favourite gotcha is this:
>
>     elt, = elts
>
> It's a nice and compact way to do both:
>
>     assert len(elts) == 0
>     elt = elts[0]

I'm confused. Your rewrite looks like an assertion error or an
IndexError.

-- 
Neil Cerutti



More information about the Python-list mailing list