ways to declare empty set variable

Steve Holden steve at holdenweb.com
Sat Feb 16 11:14:10 EST 2008


Boris Borcic wrote:
> Steve Holden wrote:
[...]
>> Before you have any code is exactly the *wrong* time to be considering 
>> performance.
> 
> Yeah right, [] and {} are premature optimizations, one should always use list() 
> or dict() unless one detains figures to justify the more exotic forms :)
> 
:-)

My natural inclination would be to go for the  literal forms where they 
are available, but that would be for readability rather than speed. If 
just happens to be a double win. It's about four years since I wrote a 
program that ran for more than 24 hours.

regards
  Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/




More information about the Python-list mailing list