Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #31137

Re: __setitem__ without position

References <CA+C4C6c7GBdxs+jZPGNrpauvZXP7caGpPb8Q466HD7mV09731Q@mail.gmail.com> <CA+C4C6eMKa6i4Vk4b7hc8SxyDyutoRKkP9VLt0g3UWs+v5ehTw@mail.gmail.com> <50773AE5.7020400@davea.name> <CA+C4C6fZJMUtwyxsRdDTKzzEQWtxrYVpDT6chn1-yyF8VDK9og@mail.gmail.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date 2012-10-11 16:43 -0600
Subject Re: __setitem__ without position
Newsgroups comp.lang.python
Message-ID <mailman.2071.1349995434.27098.python-list@python.org> (permalink)

Show all headers | View raw


On Thu, Oct 11, 2012 at 4:13 PM, Kevin Anthony
<kevin.s.anthony@gmail.com> wrote:
> I'm not supprised... and understand why it's happening.  I'm asking how to
> get around it.
>
> Basically i'm asking how to override, if i can, the `=`

You cannot override assignment of local variables.  To get around it,
use slicing as Dave suggested, or use an attribute instead of a local
variable.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: __setitem__ without position Ian Kelly <ian.g.kelly@gmail.com> - 2012-10-11 16:43 -0600

csiph-web