On Jul 12, 4:20 pm, Hrvoje Niksic <hnik...@xemacs.org> wrote:
> dhruvbird <dhruvb...@gmail.com> writes:
> > No, I meant x.append(4)
> > Except that I want to accomplish it using slices.
>
> > (I can do it as x[lex(x):] = [item_to_append] but is there any other
> > way?)
>
> It seems that you've found a way to do so, so why do you need another
> way?  Are you after elegance?  Efficiency?  Brevity?

Actually, the reason I ask is because I think a lot of things can be
done using slices and its support for negative indexes. Basically
putting constants in the slices (as opposed to variables like len(x),
etc... which depend upon the variable name). So, was just trying to
cogitate on whether append can be implemented that way or not.

Regards,
-Dhruv.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to