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: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.024 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'modules.': 0.07; 'slices': 0.07; 'subject:when': 0.07; 'python': 0.08; 'array.': 0.09; 'hallo,': 0.09; 'indexes': 0.09; 'subject:python': 0.10; 'c++': 0.12; 'class,': 0.15; 'received:internal': 0.18; '(which': 0.19; 'slice': 0.23; 'problem': 0.29; 'array': 0.30; 'url:cz': 0.30; 'from,': 0.32; 'implement': 0.32; 'to:addr:python-list': 0.34; 'behaving': 0.34; 'thank': 0.35; 'question': 0.36; 'subject:with': 0.36; 'revert': 0.37; 'two': 0.37; 'but': 0.37; 'to:addr:python.org': 0.40; '8bit%:8': 0.40; 'your': 0.61; 'kind': 0.61; 'charset:iso-8859-2': 0.62; 'from:no real name:2**0': 0.63; 'received:89': 0.64; 'accepts': 0.64; 'special': 0.68; 'received:62': 0.70; 'url:php': 0.82; 'url:click': 0.95 MIME-Version: 1.0 Subject: =?iso-8859-2?Q?Slices_when_extending_python_with_C=2B=2B_?= From: rozelak@volny.cz X-Originating-Account: rozelak/volny.cz To: python-list@python.org Date: Wed, 28 Dec 2011 00:03:08 +0100 (CET) X-Mailer: Volny.cz Webmail2 2.147 X-Originating-Ip: 89.111.119.6 X-Originating-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.121 Safari/535.2 X-Webmail2-Origin: rozelak/volny.cz [89.111.119.6] X-Priority: 3 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1325026990 news.xs4all.nl 6926 [2001:888:2000:d::a6]:40999 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:18074 Hallo, I have kind of special question when extening python with C++ implemented modules. I try to implement a class, behaving also like an array. And I need to implement slice-getters. I implemented PySequenceMethods.sq_slice to get "simple" slices like: myobj[x:y] It works perfectly, without problems. But now I have a problem when need to access the array with "special" slices, like: myobj[x:y:step] myobj[::-1] # to revert the array I would like to ask which method must be implemented to get this=20 "special" slice getters. The "simple" slice PySequenceMethods.sq_slice getter accepts only two indexes - from, to, but not a step (which would solve the issue). Thank you very much for your ansver, best regards Dan T. --=20 Tradi=E8n=ED i modern=ED adventn=ED a novoro=E8n=ED zvyky, sv=E1te=E8n=ED j= =EDdlo a pit=ED, v=FDzdoba a d=E1rky... - =E8t=ECte v=E1no=E8n=ED a silvestrovsk=FD = speci=E1l port=E1lu VOLN=DD.cz na http://web.volny.cz/data/click.php?id=3D1301