On Sat, 2007-11-03 at 01:08 -0300, Gabriel Genellina wrote:
> En Fri, 02 Nov 2007 21:07:19 -0300, Matimus <[EMAIL PROTECTED]> escribió:
>
> > On Nov 2, 3:08 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote:
> >> >>> def test_func():
> >>
> >> ... pass
> >> ...>>> import new
> >> >>> test_func2 =
En Fri, 02 Nov 2007 21:07:19 -0300, Matimus <[EMAIL PROTECTED]> escribió:
> On Nov 2, 3:08 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote:
>> >>> def test_func():
>>
>> ... pass
>> ...>>> import new
>> >>> test_func2 = new.function(test_func.func_code, {}, "test_func2")
>> >>> test_func2
>>
>> >
On Fri, 02 Nov 2007 17:08:06 -0500, Chris Mellon wrote:
def test_func():
> ... pass
> ...
import new
test_func2 = new.function(test_func.func_code, {}, "test_func2")
[snip results of timeit]
> Why almost twice the calling overhead for a dynamic function?
When I time the funct
On Nov 2, 3:08 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote:
> >>> def test_func():
>
> ... pass
> ...>>> import new
> >>> test_func2 = new.function(test_func.func_code, {}, "test_func2")
> >>> test_func2
>
> >>> test_func
>
> >>> import timeit
> >>> tf = timeit.Timer("test_func()", "from __mai
>>> def test_func():
... pass
...
>>> import new
>>> test_func2 = new.function(test_func.func_code, {}, "test_func2")
>>> test_func2
>>> test_func
>>> import timeit
>>> tf = timeit.Timer("test_func()", "from __main__ import test_func")
>>> tf.repeat()
[0.2183461704377247, 0.18068215314489791,