List comprehension strangeness

Gregory Ewing greg.ewing at canterbury.ac.nz
Mon Jul 22 19:04:50 EDT 2019


Nicholas Cole wrote:
  [x.id for x in some_function()]
> 
> According to the profiler, some_function was being called 52,000 times

Is some_function recursive, by any chance?

-- 
Greg



More information about the Python-list mailing list