On May 10, 2:39 pm, Steven Bethard <[EMAIL PROTECTED]> wrote:
> 7studwrote:
> >> Is there any documentation for the syntax you used with timeit?
>
> > This is the syntax the docs describe:
> [snip
> > python timeit.py [-n N] [-r N] [-s S] [-t] [-c] [-h] [statement ...]
> [snip]
> > Then in the exam
Peter Otten <[EMAIL PROTECTED]> wrote:
> Note the -s before the initialization statement that Alex meant to add but
> didn't. If that is missing
Yep, sorry for erroneously skipping the -s!
Alex
--
http://mail.python.org/mailman/listinfo/python-list
7stud wrote:
>> Is there any documentation for the syntax you used with timeit?
>
> This is the syntax the docs describe:
[snip
> python timeit.py [-n N] [-r N] [-s S] [-t] [-c] [-h] [statement ...]
[snip]
> Then in the examples in section 10.10.2
[snip]
> timeit.py 'try:' ' str.__nonzero__' 'exc
> Is there any documentation for the syntax you used with timeit?
This is the syntax the docs describe:
---
Python Reference Library
10.10.1:
When called as a program from the command line, the following form is
used:
python timeit.py [-n N] [-r N] [-s S] [-t] [-c] [-h] [statement ...]
---
Then
Stargaming wrote:
> Alex Martelli schrieb:
>> 7stud <[EMAIL PROTECTED]> wrote:
>>...
>>
.append - easy to measure, too:
brain:~ alex$ python -mtimeit 'L=range(3); n=23' 'x=L[:]; x.append(n)'
100 loops, best of 3: 1.31 usec per loop
brain:~ alex$ python -mtimeit '
Alex Martelli schrieb:
> 7stud <[EMAIL PROTECTED]> wrote:
>...
>
>>>.append - easy to measure, too:
>>>
>>>brain:~ alex$ python -mtimeit 'L=range(3); n=23' 'x=L[:]; x.append(n)'
>>>100 loops, best of 3: 1.31 usec per loop
>>>
>>>brain:~ alex$ python -mtimeit 'L=range(3); n=23' 'x=L[:]; x+=
7stud <[EMAIL PROTECTED]> wrote:
...
> > .append - easy to measure, too:
> >
> > brain:~ alex$ python -mtimeit 'L=range(3); n=23' 'x=L[:]; x.append(n)'
> > 100 loops, best of 3: 1.31 usec per loop
> >
> > brain:~ alex$ python -mtimeit 'L=range(3); n=23' 'x=L[:]; x+=[n]'
> > 100 loops, be
On May 9, 11:08 am, 7stud <[EMAIL PROTECTED]> wrote:
> On May 8, 11:05 pm, [EMAIL PROTECTED] (Alex Martelli) wrote:
>
>
>
> > alf <[EMAIL PROTECTED]> wrote:
> > > two ways of achieving the same effect
>
> > > l+=[n]
>
> > > or
>
> > > l.append(n)
>
> > > so which is more pythonic/faster?
>
> > .app
On May 8, 11:05 pm, [EMAIL PROTECTED] (Alex Martelli) wrote:
> alf <[EMAIL PROTECTED]> wrote:
> > two ways of achieving the same effect
>
> > l+=[n]
>
> > or
>
> > l.append(n)
>
> > so which is more pythonic/faster?
>
> .append - easy to measure, too:
>
> brain:~ alex$ python -mtimeit 'L=range(3);
On May 8, 11:05 pm, [EMAIL PROTECTED] (Alex Martelli) wrote:
> alf <[EMAIL PROTECTED]> wrote:
> > two ways of achieving the same effect
>
> > l+=[n]
>
> > or
>
> > l.append(n)
>
> > so which is more pythonic/faster?
>
> .append - easy to measure, too:
>
> brain:~ alex$ python -mtimeit 'L=range(3);
alf <[EMAIL PROTECTED]> wrote:
> two ways of achieving the same effect
>
>
> l+=[n]
>
> or
>
> l.append(n)
>
>
> so which is more pythonic/faster?
.append - easy to measure, too:
brain:~ alex$ python -mtimeit 'L=range(3); n=23' 'x=L[:]; x.append(n)'
100 loops, best of 3: 1.31 usec per
two ways of achieving the same effect
l+=[n]
or
l.append(n)
so which is more pythonic/faster?
--
alfz1
--
http://mail.python.org/mailman/listinfo/python-list
12 matches
Mail list logo