On Saturday 03 March 2007, Ben Finney wrote:
> Bjoern Schliessmann <[EMAIL PROTECTED]> writes:
>
>     if not recs.has_key(piid):      # [1]
>
Why not

if piid not in recs:

That is shorter, simpler, easier to read and very slightly faster. Plus you 
can change the data structure of recs later without changing that line so 
long as it implements containment testing.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to