Throw the cat among the pigeons

Ian Kelly ian.g.kelly at gmail.com
Tue May 5 16:30:50 EDT 2015


On Tue, May 5, 2015 at 12:45 PM, Dave Angel <davea at davea.name> wrote:
> When the "simple" is True, the function takes noticeably and consistently
> longer.  For example, it might take 116 instead of 109 seconds.  For the
> same counts, your code took 111.

I can't replicate this. What version of Python is it, and what value
of x are you testing with?

> I've looked at dis.dis(factorial_iterative), and can see no explicit reason
> for the difference.

My first thought is that maybe it's a result of the branch. Have you
tried swapping the branches, or reimplementing as separate functions
and comparing?



More information about the Python-list mailing list