Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'compiler': 0.05; 'cpython': 0.05; 'modify': 0.05; 'reject': 0.05; '"c"': 0.07; 'class,': 0.07; 'implements': 0.07; 'used.': 0.07; 'python': 0.09; 'outlined': 0.09; 'slices': 0.09; 'subject:()': 0.09; 'subset': 0.09; 'doubles.': 0.16; 'else....': 0.16; 'right;': 0.16; 'run.': 0.16; 'subject:array': 0.16; 'undesirable': 0.16; 'wrote:': 0.17; 'tests': 0.18; 'memory': 0.18; 'code.': 0.20; 'math': 0.20; 'changes': 0.20; 'otherwise,': 0.20; "i'd": 0.22; 'example': 0.23; 'machine': 0.24; 'least': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'fit': 0.26; 'bugs': 0.27; 'embedded': 0.27; 'andrew': 0.27; 'there.': 0.28; 'fine': 0.28; 'run': 0.28; 'post': 0.28; 'cpu': 0.29; 'wasting': 0.29; 'no,': 0.29; 'code': 0.31; 'point': 0.31; 'implement': 0.32; 'certain': 0.33; 'problem': 0.33; 'to:addr:python-list': 0.33; "can't": 0.34; 'pm,': 0.35; "won't": 0.35; 'something': 0.35; 'there': 0.35; 'michael': 0.36; 'but': 0.36; 'enough': 0.36; 'possible': 0.37; 'available.': 0.37; 'why': 0.37; 'previous': 0.37; 'subject:: ': 0.38; 'instead': 0.39; 'performance': 0.39; 'to:addr:python.org': 0.39; 'end': 0.40; 'think': 0.40; 'your': 0.60; 'you.': 0.61; 'received:network': 0.61; 'received:phx3.secureserver.net': 0.62; 'received:prod.phx3.secureserver.net': 0.62; 'received:unknown': 0.63; 'love': 0.63; 'behavior': 0.64; 'useful.': 0.65; 'talking': 0.66; 'header:Reply-To:1': 0.68; 'reply-to:no real name:2**0': 0.72; 'power': 0.74; 'introduce': 0.80; 'cpu,': 0.84; 'implications': 0.84; 'improvement': 0.84; 'faced': 0.91; 'received:173.201': 0.91; 'received:173.201.192': 0.91 Date: Mon, 29 Oct 2012 17:04:43 -0700 From: Andrew Robinson User-Agent: Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20111126 Thunderbird/8.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Negative array indicies and slice() 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> <508f1910$0$29967$c3e8da3$5496439d@news.astraweb.com> <508EDA40.8020003@r3dsolutions.com> <508F6B58.6060207@gmail.com> In-Reply-To: <508F6B58.6060207@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: andrew3@r3dsolutions.com 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: 32 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1351581043 news.xs4all.nl 6866 [2001:888:2000:d::a6]:46195 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:32471 On 10/29/2012 10:53 PM, Michael Torrie wrote: > On 10/29/2012 01:34 PM, Andrew Robinson wrote: >> No, I don't think it big and complicated. I do think it has timing >> implications which are undesirable because of how *much* slices are used. >> In an embedded target -- I have to optimize; and I will have to reject >> certain parts of Python to make it fit and run fast enough to be useful. > Since you can't port the full Python system to your embedded machine > anyway, why not just port a subset of python and modify it to suit your > needs right there in the C code. It would be a fork, yes, You're exactly right; That's what I *know* I am faced with. > Without a libc, an MMU on the CPU, and a kernel, it's not going to just compile and run. I have libc. The MMU is a problem; but the compiler implements the standard "C" math library; floats, though, instead of doubles. That's the only problem -- there. > What you want with slicing behavior changes has no > place in the normal cPython implementation, for a lot of reasons. The > main one is that it is already possible to implement what you are > talking about in your own python class, which is a fine solution for a > normal computer with memory and CPU power available. If the tests I outlined in the previous post inaccurately describe a major performance improvement and at least a modest code size reduction; or will *often* introduce bugs -- I *AGREE* with you. Otherwise, I don't. I don't think wasting extra CPU power is a good thing -- Extra CPU power can always be used by something else.... I won't belabor the point further. I'd love to see a counter example to the specific criteria I just provided to IAN -- it would end my quest; and be a good reference to point others to.