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


Groups > comp.lang.python > #18151

Re: Slices when extending python with C++

Path csiph.com!x330-a1.tempe.blueboxinc.net!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 <rozelak@volny.cz>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.014
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'slices': 0.07; 'subject:when': 0.07; 'python': 0.08; 'underlying': 0.09; 'subject:python': 0.10; 'c++': 0.12; 'c-api': 0.16; 'enigma': 0.16; 'kern': 0.16; 'py_ssize_t': 0.16; 'pyobject': 0.16; 'robert,': 0.16; 'signature:': 0.16; 'slice.': 0.16; 'to:addr:robert.kern': 0.16; 'looked': 0.16; 'wrote:': 0.18; 'received:internal': 0.18; 'accepting': 0.19; 'to:2**1': 0.21; 'header:In-Reply-To:1': 0.22; '-----': 0.23; 'extending': 0.23; 'slice': 0.23; 'way?': 0.23; 'function': 0.27; 'url:mailman': 0.28; 'interpret': 0.29; 'sorry,': 0.29; 'pm,': 0.29; 'url:cz': 0.30; 'url:listinfo': 0.32; 'implement': 0.32; 'named': 0.33; 'object': 0.33; 'to:addr:python-list': 0.34; 'it.': 0.34; 'thank': 0.35; 'to:no real name:2**1': 0.35; 'url:python': 0.36; 'question': 0.36; 'subject:with': 0.36; 'another': 0.37; 'hold': 0.38; 'url:org': 0.39; 'should': 0.39; 'registered': 0.39; "it's": 0.40; 'to:addr:python.org': 0.40; '8bit%:8': 0.40; 'your': 0.61; 'charset:iso-8859-2': 0.62; 'world': 0.62; 'from:no real name:2**0': 0.63; 'dear': 0.64; 'our': 0.64; 'received:89': 0.64; 'believe': 0.65; 'received:62': 0.70; 'url:php': 0.82; 'subject:++': 0.84; 'eco': 0.91; 'url:click': 0.95
MIME-Version 1.0
Subject Re: Slices when extending python with C++
From rozelak@volny.cz
X-Originating-Account rozelak/volny.cz
To robert.kern@gmail.com, python-list@python.org
Date Thu, 29 Dec 2011 00:32:27 +0100 (CET)
X-Mailer Volny.cz Webmail2 2.147
X-Originating-Ip 89.111.119.6
X-Originating-Agent Mozilla/5.0 (compatible; Konqueror/4.6; Linux) KHTML/4.6.5 (like Gecko)
X-Webmail2-Origin rozelak/volny.cz [89.111.119.6]
X-Priority 3
In-Reply-To <jdf4vc$mr9$1@dough.gmane.org>
References <18d00d51ecfd54dcfeb18e1708f6c77d@mail2.volny.cz> <jdf4vc$mr9$1@dough.gmane.org>
Content-Type text/plain; charset="iso-8859-2"
Content-Transfer-Encoding quoted-printable
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
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.4204.1325115154.27778.python-list@python.org> (permalink)
Lines 62
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1325115154 news.xs4all.nl 6970 [2001:888:2000:d::a6]:56190
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:18151

Show key headers only | View raw


Great, it's working! Thank you very much, Robert!
Dan T.

----- PŮVODNÍ ZPRÁVA -----
Od: "Robert Kern" <robert.kern@gmail.com>
Komu: python-list@python.org
Předmět: Re: Slices when extending python with C++
Datum: 28.12.2011 - 14:18:36

> On 12/28/11 1:01 PM, rozelak@volny.cz wrote:
> > Dear Robert,
> >
> > thank you very much for your answer. I
> > understand what you mean and
> > > I have looked at slice object and C-api methods
> > it provides. It
> > > should be easy to implement it.
> >
> > The only question is how exactly yo implement
> > the general getter,
> > > since sq_item you mention (assume you mean
> > PySequenceMethods.sq_item) has the following
> > signature:
> > >
> > PyObject * (* ssizeargfunc)(PyObject *,
> > Py_ssize_t)
> > >
> > accepting Py_ssize_t as the index, not a
> > PyObject * which would hold
> > > the slice.
> >
> > So, how exactly to implement the getter? As a
> > general method named
> > > __getitem__ registered in PyMethodDef? Or in
> > another way?
> > 
> Sorry, PyMappingMethods.mp_subscript is the
> general function that you need to 
> implement.
> 
> -- 
> Robert Kern
> 
> "I have come to believe that the whole world is an
> enigma, a harmless enigma
> that is made terrible by our own mad attempt to
> interpret it as though it had
> an underlying truth."
> -- Umberto Eco
> 
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 


-- 
Tradiční i moderní adventní a novoroční zvyky, sváteční jídlo a
pití, výzdoba a dárky... - čtěte vánoční a silvestrovský speciál
portálu VOLNÝ.cz na http://web.volny.cz/data/click.php?id=1301

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


Thread

Re: Slices when extending python with C++ rozelak@volny.cz - 2011-12-29 00:32 +0100

csiph-web