Performance: sets vs dicts.

Aahz aahz at
Tue Aug 31 01:42:11 CEST 2010

In article <878w3ogpvq.fsf at>,
Ben Finney  <ben+python at> wrote:
>aahz at (Aahz) writes:
>> That reminds me: one co-worker (who really should have known better ;-)
>> had the impression that sets were O(N) rather than O(1).
>For settling exactly this kind of confusion, Python's standard library
>comes with a module, the timeit module. Your co-worker should have
>known better: don't guess about timing performance, measure it.
>Or am I missing something here?

Possibly; IMO, people should not need to run timeit to determine basic
algorithmic speed for standard Python datatypes.
Aahz (aahz at           <*>

"...if I were on life-support, I'd rather have it run by a Gameboy than a
Windows box."  --Cliff Wells

More information about the Python-list mailing list