Le Wed, 14 Nov 2012 10:00:59 +0000,
Chris Withers <ch...@simplistix.co.uk> a écrit :
> On 14/11/2012 09:58, Merlijn van Deen wrote:
> > On 14 November 2012 10:12, Chris Withers <ch...@simplistix.co.uk>
> > wrote:
> >> ...which made me a little sad
> >
> > Why did it make you sad? dict() takes 0.2µs, {} takes 0.04µs. In
> > other words: you can run dict() _five million_ times per second,
> > and {} twenty-five million times per second. That is 'a lot' and 'a
> > lot'. It also means you are unlikely to notice the difference in
> > real-world code. Just use the one you feel is clearer in the
> > situation, and don't worry about micro-optimalization.
> 
> I'm inclined to agree, but it makes me sad for two reasons:
> 
> - it's something that people get hung up on, for better or worse. (if
> it wasn't, Doug wouldn't have written his article)
> 
> - it can make a difference, for example setting up a dict with many
> keys at the core of a type loop.

Well, please post examples of *real-world* use cases where it makes a
difference.
Otherwise, you're asking us to add hacks to the implementation just to
make you feel good, which is quite unacceptable.

Regards

Antoine.


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to