On Tue, 14 Jun 2011 05:37:45 -0700 (PDT), AlienBaby wrote in
Message-Id: <078c5e9a-8fad-4d4c-b081-f69d0f575...@v11g2000prk.googlegroups.com>:

> How do those methods compare to the one I normally use;
>
> try:
>  dict[key]+=1
> except:
>  dict[key]=1

This is a lot slower in percentage terms.  You should also qualify the
exception: except KeyError
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to