[Python-Dev] Complexity documentation request
Dimitrios Apostolou
jimis at gmx.net
Sat Mar 15 11:50:52 CET 2008
Hi,
I just dug into the source code looking for complexity of set
operations. In the wiki page I documented an interesting finding, that
it is different to do s-t and s.difference(t). It is also interesting
that you can do the first only for sets, but the second for every
iterable in t.
Are these portable characteristics of the python language or just
implementation specific details? In addition, can someone explain me the
usefulness of the loop starting with 'if (PyDict_CheckExact(other))' in
set_difference()? As I understand it set_difference() is always called
with two sets as arguments (set_sub() does the actual call).
I'm just trying to figure out the complexity of the other set
operations, but things get more complicated. I'd appreciate your help.
Thanks,
Dimitris
More information about the Python-Dev
mailing list