addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscontroller-playcrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1linklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonprintShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahoo

Re: [python-189] Python performance anti-patterns

From: Alex G.
Sent on: Thursday, January 10, 2013 12:24 PM
I really cannot imagine anything less import than dict() vs. {}:

Alexs-MacBook-Pro-2:pypy alex_gaynor$ ./pypy-c -mtimeit "dict()"
[masked] loops, best of 3:[masked] usec per loop
Alexs-MacBook-Pro-2:pypy alex_gaynor$ ./pypy-c -mtimeit "{}"
[masked] loops, best of 3:[masked] usec per loop

Alex


On Thu, Jan 10, 2013 at 12:21 PM, Hy Carrel <[address removed]> wrote:
Here is a nice article supporting Nam's suggestion, at least for CPython <= 2.7


Hy

On Jan 9, 2013, at 10:10 AM, Nam Nguyen <[address removed]> wrote:

Using ``dict()`` for what the literal ``{}`` can do seems to get popular.

Local vs Global lookup.

Nam


On Mon, Jan 7, 2013 at 8:48 AM, Simeon Franklin <[address removed]> wrote:


Your feedback is appreciated!





--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Nam Nguyen ([address removed]) from San Francisco Python Meetup Group.
To learn more about Nam Nguyen, visit his/her member profile




--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Hy Carrel ([address removed]) from San Francisco Python Meetup Group.
To learn more about Hy Carrel, visit his/her member profile Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]



--
"I disapprove of what you say, but I will defend to the death your right to say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
"The people's good is the highest law." -- Cicero

Our Sponsors

  • Yelp

    Platinum Sponsor, also a host for majority of our events.

  • Sentry

    Sponsoring the venue, food, and drinks for Open Source Sprint weekend

  • Google Launchpad Space

    Sponsoring the venue, food, and drinks for Project Night in April

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy