Robert Bradshaw wrote:
> On Oct 27, 2009, at 3:15 AM, Francois Maltey wrote:
>
>
>> Hello,
>>
>> I'm an old lisp-list user and python is my first use of dynamic
>> array-list.
>>
>> Complexity for lisp-list is constant and fast o(1) when we add a new
>> element at the head of the list.
>> (co
On Oct 27, 2009, at 3:15 AM, Francois Maltey wrote:
> Hello,
>
> I'm an old lisp-list user and python is my first use of dynamic
> array-list.
>
> Complexity for lisp-list is constant and fast o(1) when we add a new
> element at the head of the list.
> (cons e L) in Lisp or e::L in caml.
>
> Co
Hello,
I'm an old lisp-list user and python is my first use of dynamic array-list.
Complexity for lisp-list is constant and fast o(1) when we add a new
element at the head of the list.
(cons e L) in Lisp or e::L in caml.
Complexity is also o(1) when we take the end of the list, or read the
fi
Great, thanks to both of you. No wonder I didn't see it in the
documentation for lists! Luckily my lists are probably very short
(len<5) so don't have to worry about algorithms for now, just a
bugfix.
- kcrisman
On Oct 26, 5:02 pm, Jason Grout wrote:
> Dag Sverre Seljebotn wrote:
>
> > a) for
Dag Sverre Seljebotn wrote:
>
> a) for x in L[:]: ... # makes a copy
> b) remove from the end of the list...
c) use list comprehensions to construct a new list, then del the old list.
Jason
--~--~-~--~~~---~--~~
To post to this group, send email to sage-suppo
kcrisman wrote:
> Dear support,
>
> I'm trying to resolve #7315 and have discovered something that
> disturbs me, but probably is reasonable to someone who really
> understands Python lists. Namely:
>
> {{{
L=[1,2,3,4]
for x in L:
> ... L.remove(x)
> ... x
> ... L
> ...
>
kcrisman wrote:
> Dear support,
>
> I'm trying to resolve #7315 and have discovered something that
> disturbs me, but probably is reasonable to someone who really
> understands Python lists. Namely:
>
> {{{
L=[1,2,3,4]
for x in L:
> L.remove(x)
> x
> L
> ...