Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #59859

Re: Oh look, another language (ceylon)

Path csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'string.': 0.05; 'indexing': 0.07; 'string': 0.09; '32-bit': 0.09; 'character,': 0.09; 'counting': 0.09; 'span': 0.09; 'subject:language': 0.09; 'supported,': 0.09; 'expensive,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'iteration': 0.16; 'surrogate': 0.16; 'underlying': 0.16; 'wrote:': 0.18; 'trying': 0.19; "hasn't": 0.19; 'manual': 0.22; 'string,': 0.24; 'unicode': 0.24; 'mon,': 0.24; 'equivalent': 0.26; 'certain': 0.27; 'header:In- Reply-To:1': 0.27; 'appear': 0.29; 'am,': 0.29; 'character': 0.29; 'characters': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'operations.': 0.31; 'this.': 0.32; 'figure': 0.32; 'beginning': 0.33; 'subject: (': 0.35; 'operations': 0.35; 'received:google.com': 0.35; 'there': 0.35; "didn't": 0.36; 'thanks': 0.36; 'searching': 0.37; 'so,': 0.37; 'nov': 0.38; 'requiring': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'rather': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'ian': 0.60; 'find.': 0.84; '2013': 0.98
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:to :content-type; bh=troHqLpKNmvHBsW1IZNlTG91YI9xBxU4WVy8wIFTtoM=; b=qKTnIpohBDDCv9r2PZaGfRnWgQK3xDLIXnWwgOFYl8DagEMRTeemZukCTLX0yjLp2y 7oDF1MG2HN7SwUzxCAstad2msVXAAXoY9yGLwUryA8irkuGJpuEgiSbdbEbxgPxXK49U Ne+vu3MswMbCmzMJlb7OFZHHNPc2XoKW+Uo+rI/hgc4n7kJhzu1FhXktx7Xnd6Cn4MTo 48WHvpKok+/lQ2ovRu7JJBBMvBzNvM7Zueb1qySeNFeOdy8sRfajx5Sri3BOijLeMQjr ij759j5MiopUjM7ATxf4uUA/BkPp38QOeZ9Xj5Unagghhqyr/vEZa0Kqh01rVJLgFDsy u8mQ==
MIME-Version 1.0
X-Received by 10.66.248.202 with SMTP id yo10mr340312pac.177.1384778189196; Mon, 18 Nov 2013 04:36:29 -0800 (PST)
In-Reply-To <CALwzidnBN9-Xek23MVs_2QBUPZOiY73bu3GPqBdvPtq8wcj44w@mail.gmail.com>
References <mailman.2549.1384371222.18130.python-list@python.org> <beqs6jF6ojmU1@mid.individual.net> <1f0ffad0-f9b1-4154-b048-510d8e38846e@googlegroups.com> <betrckFpdk9U1@mid.individual.net> <mailman.2823.1384757801.18130.python-list@python.org> <41f332dd-1c31-4699-9176-7e8589f9c8ae@googlegroups.com> <CAPTjJmoJ1FPzP8JyAufNx1B6jZgrCzfEmbU96K_JukVa_v5TiQ@mail.gmail.com> <CALwzidnBN9-Xek23MVs_2QBUPZOiY73bu3GPqBdvPtq8wcj44w@mail.gmail.com>
Date Mon, 18 Nov 2013 23:36:29 +1100
Subject Re: Oh look, another language (ceylon)
From Chris Angelico <rosuav@gmail.com>
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 <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2840.1384778198.18130.python-list@python.org> (permalink)
Lines 25
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1384778198 news.xs4all.nl 15940 [2001:888:2000:d::a6]:51685
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:59859

Show key headers only | View raw


On Mon, Nov 18, 2013 at 11:29 PM, Ian Kelly <ian.g.kelly@gmail.com> wrote:
>
> On Nov 18, 2013 3:06 AM, "Chris Angelico" <rosuav@gmail.com> wrote:
>>
>> I'm trying to figure this out. Reading the docs hasn't answered this.
>> If each character in a string is a 32-bit Unicode character, and (as
>> can be seen in the examples) string indexing and slicing are
>> supported, then does string indexing mean counting from the beginning
>> to see if there were any surrogate pairs?
>
> The string reference says:
>
> """Since a String has an underlying UTF-16 encoding, certain operations are
> expensive, requiring iteration of the characters of the string. In
> particular, size requires iteration of the whole string, and get(), span(),
> and segment() require iteration from the beginning of the string to the
> given index."""
>
> The get and span operations appear to be equivalent to indexing and slicing.

Right, that's what I was looking for and didn't find. (I was searching
the one-page reference manual rather than reading in detail.) So, yes,
they're O(n) operations. Thanks for hunting that down.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Oh look, another language (ceylon) Neal Becker <ndbecker2@gmail.com> - 2013-11-13 14:33 -0500
  Re: Oh look, another language (ceylon) Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-11-17 16:41 +1300
    Re: Oh look, another language (ceylon) Chris Angelico <rosuav@gmail.com> - 2013-11-17 15:10 +1100
    Re: Oh look, another language (ceylon) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-11-17 05:48 +0000
      Re: Oh look, another language (ceylon) jkn <jkn_gg@nicorp.f9.co.uk> - 2013-11-17 00:34 -0800
    Re: Oh look, another language (ceylon) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-17 12:41 +0000
      Re: Oh look, another language (ceylon) Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-11-18 11:33 +1300
        Re: Oh look, another language (ceylon) Chris Angelico <rosuav@gmail.com> - 2013-11-18 11:42 +1100
        Re: Oh look, another language (ceylon) Tim Daneliuk <tundra@tundraware.com> - 2013-11-17 16:48 -0600
          Re: Oh look, another language (ceylon) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-18 23:51 +0000
            Re: Oh look, another language (ceylon) Tim Daneliuk <tundra@tundraware.com> - 2013-11-18 18:31 -0600
    Re: Oh look, another language (ceylon) Rick Johnson <rantingrickjohnson@gmail.com> - 2013-11-17 16:18 -0800
      Re: Oh look, another language (ceylon) Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-11-18 19:45 +1300
        Re: Oh look, another language (ceylon) Chris Angelico <rosuav@gmail.com> - 2013-11-18 17:56 +1100
          Re: Oh look, another language (ceylon) wxjmfauth@gmail.com - 2013-11-18 01:44 -0800
            Re: Oh look, another language (ceylon) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-18 09:56 +0000
            Re: Oh look, another language (ceylon) Chris Angelico <rosuav@gmail.com> - 2013-11-18 21:04 +1100
              Re: Oh look, another language (ceylon) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-11-18 13:31 +0000
                Re: Oh look, another language (ceylon) Chris Angelico <rosuav@gmail.com> - 2013-11-19 00:39 +1100
                Re: Oh look, another language (ceylon) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-11-18 14:30 +0000
                Re: Oh look, another language (ceylon) Dave Angel <davea@davea.name> - 2013-11-18 15:37 -0500
                Re: Oh look, another language (ceylon) Steven D'Aprano <steve@pearwood.info> - 2013-11-19 02:29 +0000
                Re: Oh look, another language (ceylon) Chris Angelico <rosuav@gmail.com> - 2013-11-19 10:25 +1100
                Re: Oh look, another language (ceylon) Steven D'Aprano <steve@pearwood.info> - 2013-11-19 02:13 +0000
                Re: Oh look, another language (ceylon) Chris Angelico <rosuav@gmail.com> - 2013-11-19 13:54 +1100
                Re: Oh look, another language (ceylon) Chris Angelico <rosuav@gmail.com> - 2013-11-19 13:56 +1100
                Re: Oh look, another language (ceylon) wxjmfauth@gmail.com - 2013-11-19 01:10 -0800
                Re: Oh look, another language (ceylon) Bob Martin <bob.martin@excite.com> - 2013-11-20 08:19 +0000
            Re: Oh look, another language (ceylon) Ian Kelly <ian.g.kelly@gmail.com> - 2013-11-18 05:29 -0700
            Re: Oh look, another language (ceylon) Chris Angelico <rosuav@gmail.com> - 2013-11-18 23:36 +1100
              Re: Oh look, another language (ceylon) Piet van Oostrum <piet@vanoostrum.org> - 2013-11-18 10:31 -0400
                Re: Oh look, another language (ceylon) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-18 15:06 +0000
        Re: Oh look, another language (ceylon) Rick Johnson <rantingrickjohnson@gmail.com> - 2013-11-18 19:33 -0800
          Re: Oh look, another language (ceylon) Steven D'Aprano <steve@pearwood.info> - 2013-11-19 07:00 +0000
            Re: Oh look, another language (ceylon) Chris Angelico <rosuav@gmail.com> - 2013-11-19 18:18 +1100
            Re: Oh look, another language (ceylon) Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-11-20 18:25 +1300
  Re: Oh look, another language (ceylon) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-11-18 14:56 +0000

csiph-web