Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Random832 Newsgroups: comp.lang.python Subject: Re: Strange range Date: Sun, 03 Apr 2016 01:20:52 -0400 Lines: 16 Message-ID: References: <87y48xjwqq.fsf@elektro.pacujo.net> <56fe76f2$0$22141$c3e8da3$5496439d@news.astraweb.com> <87lh4xjt37.fsf@elektro.pacujo.net> <1671ea2b-09ff-4745-a6e7-d2c57864cba3@googlegroups.com> <87zitbpwpr.fsf@elektro.pacujo.net> <57009f91$0$1612$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de RzR4JeOBbIVFCbFKFmQadQp8aQ8AtMlurBzCY8d+Smzg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'guido': 0.05; 'received:internal': 0.09; 'message- id:@webmail.messagingengine.com': 0.16; 'now),': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:10.202.2.212': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:66.111.4.27': 0.16; 'received:io': 0.16; 'received:messagingengine.com': 0.16; 'received:out3-smtp.messagingengine.com': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'object.': 0.22; 'occurs': 0.22; 'rid': 0.22; '(you': 0.23; 'header:In-Reply-To:1': 0.24; "doesn't": 0.26; 'back.': 0.27; 'yield': 0.27; 'comparison': 0.29; 'it."': 0.29; 'url:peps': 0.29; "can't": 0.32; 'url:python': 0.33; "d'aprano": 0.33; 'operations.': 0.33; 'steven': 0.33; 'url:dev': 0.35; 'but': 0.36; 'should': 0.36; 'url:org': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'received:66': 0.38; 'several': 0.38; 'to:addr:python.org': 0.40; 'header :Message-Id:1': 0.61; 'personally': 0.61; 'repeat': 0.67; 'ranges': 0.76 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=tIHaLAjyXj4SeUWbkGRfKsvUUlw=; b=kIijLm VVOdiXHsao3oztwh/mkOjdRWI9wrrJqDo+QXNYuTIomoqPpsmCBqqpLAIdhyu2Ar CRAlK2DwcgLZb5FO/WNaFY4xLErmX/Z0u1XFCkzFK3A0NBRe+Pm37AVejLgL07EL 60KEPFCMzg6me+r5Hz9FJJ4KdKvzgMF4IbByk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=tIHaLAjyXj4SeUW bkGRfKsvUUlw=; b=e/7Mc89Wp2pMdKz5K9457Ryi7n9cL2oYawWQVs+wMIjqL4K XqZ9TEKjuVrPX03x/kq4blaVP3BjcdIWXg26isanj6loPhcXKr5GHZXLP8HUwsuM 2tIYApb89qE7ZyHk+rQcyOTNnAl8ej9s6lH+Ecr7JpEdagkl3g4rnCp0PrMU= X-Sasl-Enc: eKw2jOU+n4iLzpJzspkjaZvyqb57ytjFOctt729j92e2 1459660852 X-Mailer: MessagingEngine.com Webmail Interface - ajax-2373d6a1 In-Reply-To: <57009f91$0$1612$c3e8da3$5496439d@news.astraweb.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:106347 On Sun, Apr 3, 2016, at 00:43, Steven D'Aprano wrote: > If you personally don't see any advantage in this, so be it, but you > might > not be aware of the history of (x)range: > > Guido in 2001: "Nobody uses this extra functionality, and its buggy, > let's > get rid of it." > > https://www.python.org/dev/peps/pep-0260/ Several of those features apparently never did come back. The repeat count never did (you can't multiply ranges now), and it occurs to me that slicing a range that has a repeat count is intractable: (range(3)*2)[1:5] should yield 1, 2, 0, 1, which can't be represented as a range object. It also doesn't support comparison operations.