Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'interpreter': 0.04; 'attribute': 0.05; '"c"': 0.07; 'api': 0.09; 'python': 0.09; 'subject:()': 0.09; 'stored': 0.10; 'static': 0.13; '.py': 0.16; 'code?': 0.16; 'members?': 0.16; 'oct': 0.16; 'pymemberdef': 0.16; 'subject:array': 0.16; '{0}': 0.16; 'wrote:': 0.17; 'struct': 0.22; 'defined': 0.22; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'andrew': 0.27; 'start,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'interface': 0.27; 'source': 0.29; 'code': 0.31; 'file': 0.32; 'legacy': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'mapping': 0.35; 'received:209.85': 0.35; 'level': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'mean': 0.38; 'skip:o 20': 0.38; 'to:addr:python.org': 0.39; 'step': 0.39; 'header:Received:5': 0.40; '30,': 0.62; 'mentioned': 0.63; 'step),': 0.84; 'stop,': 0.84; '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=mcU96JISzyI6QYTMA+3eHlIQMbXaIH8iL1VzhOJ0SkI=; b=GHnKMSr746hyOen/JPAfWQymQZ91yqJARwViV2EdrD/Qdq0LrfRCUvuxym3Q/XU2Qy Dxcd5ZLyLPB2fVvdEugEAGofaTPCSeMkE+kqtif3ShnkJEvkEZErwdm8+LmfgqOjgH4M Q9Vpogfx8XmVZcAr1m9sOyUHH5cEftk1WMsv3iLQEjDwQdkPzY7Zyqv5Ahif/1fp8eN2 p2sCzCXtzM8QeNl42WrfI1T+g+v3W+m7iPVQuABVEmORcqrEeCjA8ZShbhpnJNPqaKsD kxUJUe8KjhX9IRirC68VKTIz2iIiptuMNB+iDHGmswLYgNreX5D7AxG7hbUTaZqAQfbr XmEw== MIME-Version: 1.0 In-Reply-To: <508FE24E.1060501@r3dsolutions.com> References: <6998a955-7b34-4f4f-b8d6-62d1028f7561@googlegroups.com> <4c024364-84df-403b-8b9e-4a4c8f06121c@googlegroups.com> <508e6649$0$29967$c3e8da3$5496439d@news.astraweb.com> <508E1BC9.3000308@r3dsolutions.com> <508EC428.5080808@r3dsolutions.com> <508FFCD6.3010305@stoneleaf.us> <508FE24E.1060501@r3dsolutions.com> From: Ian Kelly Date: Tue, 30 Oct 2012 15:55:41 -0600 Subject: Re: Negative array indicies and slice() To: Python 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1351634173 news.xs4all.nl 6869 [2001:888:2000:d::a6]:57099 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:32508 On Tue, Oct 30, 2012 at 8:21 AM, Andrew Robinson wrote: > D'Apriano mentioned the named values, start, stop, step in a slice() which > are an API and legacy issue; These three names must also be stored in the > interpreter someplace. Since slice is defined at the "C" level as a struct, > have you already found these names in the source code (hard-coded), or are > they part of a .py file associated with the interface to the "C" code? You mean the mapping of Python attribute names to C struct members? That's in sliceobject.c: static PyMemberDef slice_members[] = { {"start", T_OBJECT, offsetof(PySliceObject, start), READONLY}, {"stop", T_OBJECT, offsetof(PySliceObject, stop), READONLY}, {"step", T_OBJECT, offsetof(PySliceObject, step), READONLY}, {0} };