"Newbie" questions - "unique" sorting ?

Kim Petersen kp at kyborg.dk
Thu Jun 26 08:21:16 EDT 2003


Bryan wrote:
> i just did a test comparing:
> 
> if key not in mydict:
> 
> and
> 
> if not mydict.has_key(key):
> 
> and the 1st way cameout 28% faster.  (on python 2.3)
> 
Must be functioncall overhead then... lack of optimization in compiler? 
since the two lines are functionally completely equivalent.

Unfortunate for me, fortunate for those who don't have to write code for 
older python implementations ;-/

> bryan


-- 
Med Venlig Hilsen / Regards

Kim Petersen - Kyborg A/S (Udvikling)
IT - Innovationshuset
Havneparken 2
7100 Vejle
Tlf. +4576408183 || Fax. +4576408188





More information about the Python-list mailing list