Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder3.xlned.com!newsfeed.xs4all.nl!newsfeed4a.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.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'valueerror:': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; '"x"': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'ought': 0.16; 'record:': 0.16; 'subclass': 0.16; 'subject:bit': 0.16; 'exception': 0.16; 'wrote:': 0.18; 'feb': 0.22; 'example': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'header:In- Reply-To:1': 0.27; 'am,': 0.29; 'friends,': 0.30; 'message- id:@mail.gmail.com': 0.30; '"",': 0.31; '>>>>': 0.31; 'file': 0.32; '(most': 0.33; 'fri,': 0.33; 'skip:u 20': 0.35; 'received:google.com': 0.35; '14,': 0.36; 'step': 0.37; 'that,': 0.38; 'recent': 0.39; 'otten': 0.84; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=FBciQsivHKLa9RDyNm/+x7Pg+p0/HydzCzLeiqeUkDU=; b=unniGrFaz28BweMgkoujnUPJFV1nQhkdNad7LGViyvpTU6YHUOkhBA0ZRsKnV/GUxh CTAmMSnPuazWlEwjDL4jNhmaBcXoDck9cJ0RuvRmwYcegqdBwghgsLHCtRhTR/aV23sc 8IkLBpVaA/vRvWmqU8BYVJqo/Ol9qbZlWpqEwxy7rdb8u86/NQepDkbnKiM4TV2YKxBB O+8pGZ+3sOOF5R+5M9Jhr1jVMVW2sSOCzEHApKu7n8DgFi8M9ekUShHCIa12HrHSuX+r L0pgneD/RgxiBoFjMxAk9ottu0zhp+cYyXfJOxYl9A2kNj2ZG7aEyDP8UTuAOfZYSY7W V1og== MIME-Version: 1.0 X-Received: by 10.68.108.194 with SMTP id hm2mr4387102pbb.22.1392325844642; Thu, 13 Feb 2014 13:10:44 -0800 (PST) In-Reply-To: References: <4cc09129-43ee-4205-a24c-03f92b594abc@googlegroups.com> Date: Fri, 14 Feb 2014 08:10:44 +1100 Subject: Re: A curious bit of code... From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 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: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1392325848 news.xs4all.nl 2888 [2001:888:2000:d::a6]:44897 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:66243 On Fri, Feb 14, 2014 at 8:06 AM, Peter Otten <__peter__@web.de> wrote: > For the record: > >>>> s = "x" >>>> s[::len(s)-1] > Traceback (most recent call last): > File "", line 1, in > ValueError: slice step cannot be zero And that, my friends, is a classic example of a Python exception that ought to be a subclass of UnhingedProgrammerError. ChrisA