On Thu, Dec 15, 2011 at 12:08:48AM +0100, Laura Creighton wrote:
> In a message of Wed, 14 Dec 2011 14:36:43 PST, kirby urner writes:
> >> Isn't this at least as readable, and conceptually simpler?
> >>
> >> if ext in res_dict:
> >>    res_dict[ext] += 1
> >> else:
> >>    res_dict[ext] = 1
> >
> >I get that a lot too and often propose my one-liner.  This is not a
> >matter of flagging a mistake, just showing another way.
> >
> >It's a chance to learn dict methods better and hey, they're paying to
> >have a pro coach.
> >
> >Kirby
> 
> This looks suspiciously like 'I am a superior being because I know more
> obscure methods that you do, and obscure knowledge defines the professional'.
> Bleah.

Kirby thinks the one-liner is more readable than the 4-liner. So do I.
Apparently this is something upon which reasonable people can disagree. :)

David H
_______________________________________________
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig

Reply via email to