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


Groups > comp.lang.python > #31137

Re: __setitem__ without position

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'attribute': 0.05; 'override': 0.07; 'variables.': 0.07; 'subject:position': 0.09; 'oct': 0.16; 'received:mail-wi0-f178.google.com': 0.16; 'suggested,': 0.16; 'variable.': 0.16; 'wrote:': 0.17; 'basically': 0.17; 'thu,': 0.17; 'assignment': 0.22; 'kevin': 0.23; 'header:In-Reply-To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'received:209.85.212': 0.28; "i'm": 0.29; 'asking': 0.32; '11,': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'pm,': 0.35; 'received:209.85': 0.35; 'why': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'instead': 0.39; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'to:name:python': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=eZiHn0w1V5G1A+qpAQbJ/xQUgws7paxdOp1WVM7kX6E=; b=aYYayu7pCJ8h+3gaEd/n7ZSXVt+w23icsvDkyRF2jSau/ixHC5Yf9pXUj39PM0KCoj s4gYY4rCBf1sg+jPo5BkhzVviiqeF/DIFnhq/jii+5L99NuZxd9Rp8+HI1D12AxZKgFV WPKDuA19GoiqA9o02S1cCWaL49Ag4+bBIioCF9MfqiALxZ8UJtyfPJRntrcEFDeuxomO 7QnDvug2KR5kg9G4sv76LZ0KqUqAWKtsDep9cZVRzpA4Y+5VFDDjnqRxfzgRSXyznAWw GwAGRfw4QVnm0L9nhF6VkuNpEhemsHtKh0cjRrTlpAXSkkgprpxRatwyLhlQ5pA4qn/Y +lRw==
MIME-Version 1.0
In-Reply-To <CA+C4C6fZJMUtwyxsRdDTKzzEQWtxrYVpDT6chn1-yyF8VDK9og@mail.gmail.com>
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 Thu, 11 Oct 2012 16:43:21 -0600
Subject Re: __setitem__ without position
To Python <python-list@python.org>
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2071.1349995434.27098.python-list@python.org> (permalink)
Lines 10
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1349995434 news.xs4all.nl 6932 [2001:888:2000:d::a6]:35191
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:31137

Show key headers only | 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