John Nagle <[EMAIL PROTECTED]> writes:
>    What's the cheapest way to test for an empty dictionary in Python?
> 
>       if len(dict.keys() > 0) :

I like to think len(dict) is constant time but I haven't checked the code.
Same for bool(dict) (which is what you get when you run "if dict: ...").
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to