Path: csiph.com!usenet.pasdenom.info!gegeweb.org!newsfeed.kamp.net!newsfeed.kamp.net!newsfeed.freenet.ag!news2.euro.net!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.018 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'string.': 0.05; 'subject:Python': 0.06; 'string': 0.09; 'compact': 0.09; 'feature.': 0.09; 'function:': 0.09; 'lookup': 0.09; 'pep': 0.09; 'sure,': 0.09; 'stored': 0.12; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'opened.': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'bytes': 0.24; 'header': 0.24; 'mention': 0.26; 'post': 0.26; 'subject:/': 0.26; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'feature': 0.29; 'url:bugs': 0.29; 'am,': 0.29; 'character': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; "d'aprano": 0.31; 'intellectual': 0.31; 'steven': 0.31; 'url:se': 0.31; 'url:python': 0.33; 'implemented': 0.33; 'received:209.85': 0.35; 'something': 0.35; 'case,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'possible': 0.36; 'similar': 0.36; 'url:org': 0.36; 'should': 0.36; 'too': 0.37; 'received:209': 0.37; 'to:addr:python-list': 0.38; 'issue': 0.38; 'bad': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'most': 0.60; 'simple': 0.61; 'worth': 0.66; 'here': 0.66; 'determine': 0.67; 'request.': 0.70; 'apart': 0.72; 'bmp,': 0.84; "it'd": 0.84; 'pike': 0.84; 'subject:long': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=B4s2M4PfJCC7dDlrvaIcwLc1U7nndWfaV3xKzW02Qhk=; b=ickxIk933k5WHUYEXUx31YzM+FGp5FbBp5/RxBFpgWFmjm6w5HOTklW3sXyYiTg44+ IEN0j7z3+QSp2msM7JoUoFyLnfptP1FkjgLZvtJ37Rusoxtpsu9IabR53ekzMTwUbWYV fuBw2TPoUUAqITwt9gUb4On0ETiB1jdmrM2PRGVwKinUpi7wGVf+zufKGeW3OgBGvAib G74gIgEop1dbuZdpMDjpedqFr7U5qIV2BWqh9sMtuwcH7A+rz9eLHKHoU9k9Yy9qi3Ei tmpZVFxN0BLnFjrbRJBlmzSmtak9DbTq+2v4wWEGp8t7iCzD2WpaC2qYTq9C4kDYQnlC zncQ== MIME-Version: 1.0 X-Received: by 10.52.16.211 with SMTP id i19mr2359164vdd.91.1365026239215; Wed, 03 Apr 2013 14:57:19 -0700 (PDT) In-Reply-To: <515c45ad$0$29966$c3e8da3$5496439d@news.astraweb.com> References: <87dff083-14d8-4163-89f3-d78a9be6c802@c15g2000vbl.googlegroups.com> <3qadncD4-6fcPsbMnZ2dnUVZ_rqdnZ2d@westnet.com.au> <515bbedb$0$29891$c3e8da3$5496439d@news.astraweb.com> <515be00e$0$29891$c3e8da3$5496439d@news.astraweb.com> <515c45ad$0$29966$c3e8da3$5496439d@news.astraweb.com> Date: Thu, 4 Apr 2013 08:57:19 +1100 Subject: Re: Performance of int/long in Python 3 From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1365026247 news.xs4all.nl 6890 [2001:888:2000:d::a6]:51261 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:42708 On Thu, Apr 4, 2013 at 2:07 AM, Steven D'Aprano wrote: > On Thu, 04 Apr 2013 01:17:28 +1100, Chris Angelico wrote: > >> Probably, but it still has to scan the body of the string. It'd not be >> too bad if it's all astral, but if it's all BMP, it has to scan the >> whole string. In the max() case, it has to scan the whole string anyway, >> as there's no other way to determine the maximum. I'm thinking here of >> this function: >> >> http://pike.lysator.liu.se/generated/manual/modref/ex/7.2_3A_3A/String/ > width.html >> >> It's implemented as a simple lookup into the header. (Pike strings, like >> PEP 393 strings, are stored in the most compact way possible - 1, 2, or >> 4 bytes per character - with a conceptually similar header structure.) >> Is this something that would be worth having available? Should I post an >> issue about it? > > I'm not really sure why I would want to know, apart from pure > intellectual curiosity, but sure, post a feature request. Be sure to > mention that Pike supports this feature. http://bugs.python.org/issue17629 opened. ChrisA