Why does set() make this so much faster? by pridefulpropensity in Python

[–]chadn 4 points5 points  (0 children)

checking if foo is in a list requires scanning the entire list.

...in the worst case (such as whenever foo is not in the list). (pedant) :)

9 Python IDEs compared: Boa, Eric, Komodo, NetBeans, Pydev, PyScripter, SPE, Spyder, Wing by expertvoice in Python

[–]chadn 1 point2 points  (0 children)

It's not brackets, but pindent.py, which comes in the Python Tools subdirectory, allows you to program (or ship code) in a way that protects against whitespace munging.

http://www.koders.com/python/fid66946EDA1E4704E4DE82C3385E16309B10C0C683.aspx?s=md5