"?:", "a and b or c" or "iif"

Fred L. Drake fdrake at cnri.reston.va.us
Thu May 27 11:22:02 EDT 1999


Hrvoje Niksic writes:
 > I'm curious -- why?  Is creating and referencing a tuple really faster 
 > than creating and referencing a list?

  Creating a tuple costs one less malloc() than a non-empty list.  So
Timbot's code is faster by two malloc()s.


  -Fred

--
Fred L. Drake, Jr.	     <fdrake at acm.org>
Corporation for National Research Initiatives




More information about the Python-list mailing list