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


Groups > comp.lang.python > #77664

Re: How to turn a string into a list of integers?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <kurt.alfred.mueller@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.006
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'argument': 0.05; 'string': 0.09; 'explanation': 0.09; 'subject:into': 0.09; 'subject:string': 0.09; 'subject:How': 0.10; 'python': 0.11; 'kurt': 0.12; '2.7': 0.14; '2.7:': 0.16; 'ordinal': 0.16; 'pairs': 0.16; 'surrogate': 0.16; 'unicode,': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'code,': 0.22; 'manual': 0.22; 'interpret': 0.24; 'unicode': 0.24; 'mention': 0.26; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'array': 0.29; 'subject:list': 0.30; 'code': 0.31; 'that.': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'url:python': 0.33; 'received:google.com': 0.35; 'version': 0.36; 'representing': 0.36; 'charset:us-ascii': 0.36; 'thanks': 0.36; 'subject:?': 0.36; 'url:org': 0.36; 'two': 0.37; 'message- id:@gmail.com': 0.38; 'url:library': 0.38; 'to:addr:python-list': 0.38; 'does': 0.39; 'though,': 0.39; 'to:addr:python.org': 0.39; 'skip:u 10': 0.60; 'received:62': 0.63; 'header:Message-Id:1': 0.63; 'email addr:gmail.com': 0.63; 'irrelevant': 0.84; 'unclear': 0.84; 'remember,': 0.93
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=BSkye6+1KOSYsI3x+EFkF+MBsvPaujiDUiaI1GGGhG8=; b=x1+FQMNMdkwDGiTk1T1dx+Ypp0nEabglZlAljcl34BxH+uFD4OLWg8/s60A2EH3qh5 +wCna3IESx5I8HjN2+4LfFL+vZARqi3UWprrabexIh9fgPWs2NOdJ7cf9HM/QpeNJfRM NTrAi4tlMbAPZhx0N+7OT4MARdiF9GtTovel69ZhKgCLrbeJjHyOZbZ3UnWxdISe9y6d xaEM9XhTxSQ2/ztFhVXVETl4/jecSKxokoS4LbQXBV7SZ1Hx0rsO/+djj+ncGlBQV2jK W6AlTbq2RxoiqSI1PV2fbgFIvZ/cSFegyDrbMUg2u0YlNfuHWIDZpMRpcFIt2GcV+FLZ YP7A==
X-Received by 10.180.20.6 with SMTP id j6mr11868910wie.64.1410031697323; Sat, 06 Sep 2014 12:28:17 -0700 (PDT)
Content-Type text/plain; charset=us-ascii
Mime-Version 1.0 (Mac OS X Mail 7.3 \(1878.6\))
Subject Re: How to turn a string into a list of integers?
From Kurt Mueller <kurt.alfred.mueller@gmail.com>
In-Reply-To <540b504a$0$29974$c3e8da3$5496439d@news.astraweb.com>
Date Sat, 6 Sep 2014 21:28:14 +0200
Content-Transfer-Encoding quoted-printable
References <h2ejdb-mdk.ln1@chris.zbmc.eu> <mailman.13738.1409748804.18130.python-list@python.org> <1amjdb-p3n.ln1@chris.zbmc.eu> <mailman.13776.1409864831.18130.python-list@python.org> <1k9odb-1qs.ln1@chris.zbmc.eu> <mailman.13801.1409939785.18130.python-list@python.org> <540aa002$0$29968$c3e8da3$5496439d@news.astraweb.com> <mailman.13833.1410005730.18130.python-list@python.org> <540b504a$0$29974$c3e8da3$5496439d@news.astraweb.com>
To python-list@python.org
X-Mailer Apple Mail (2.1878.6)
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.13842.1410031704.18130.python-list@python.org> (permalink)
Lines 47
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1410031704 news.xs4all.nl 2837 [2001:888:2000:d::a6]:52592
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:77664

Show key headers only | View raw


Am 06.09.2014 um 20:19 schrieb Steven D'Aprano <steve+comp.lang.python@pearwood.info>:
> Kurt Mueller wrote:
> [...]
>> Now the part of the two Python builds is still somewhat unclear to me.
> [...]
>> In Python 2.7:
>> As I learned from the ord() manual:
>> If a unicode argument is given and Python was built with UCS2 Unicode,
> Where does the manual mention UCS-2? As far as I know, no version of Python
> uses that.

https://docs.python.org/2/library/functions.html?highlight=ord#ord


[snip] very detailed explanation of narrow/wide build, UCS-2/UCS-4, UTF-16/UTF-32



> Remember, though, these internal representations are (nearly) irrelevant to
> Python code. In Python code, you just consider that a Unicode string is an
> array of ordinal values from 0x0 to 0x10FFFF, each representing a single
> code point U+0000 to U+10FFFF. The only reason I say "nearly" is that
> narrow builds don't *quite* work right if the string contains surrogate
> pairs.

So I can interpret your last section:
Processing any Unicode string will work with small and wide
python 2.7 builds and also with python >3.3?
( parts of small build python will not work with values over 0xFFFF )
( strings with surrogate pairs will not work correctly on small build python )



Many thanks for your detailed answer!
-- 
Kurt Mueller, kurt.alfred.mueller@gmail.com

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


Thread

How to turn a string into a list of integers? cl@isbd.net - 2014-09-03 13:27 +0100
  Re: How to turn a string into a list of integers? Peter Otten <__peter__@web.de> - 2014-09-03 14:52 +0200
    Re: How to turn a string into a list of integers? cl@isbd.net - 2014-09-03 15:48 +0100
      Re: How to turn a string into a list of integers? Joshua Landau <joshua@landau.ws> - 2014-09-04 22:06 +0100
        Re: How to turn a string into a list of integers? cl@isbd.net - 2014-09-05 09:42 +0100
          Re: How to turn a string into a list of integers? Kurt Mueller <kurt.alfred.mueller@gmail.com> - 2014-09-05 19:56 +0200
            Re: How to turn a string into a list of integers? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-06 15:47 +1000
              Re: How to turn a string into a list of integers? Peter Otten <__peter__@web.de> - 2014-09-06 10:22 +0200
                Re: How to turn a string into a list of integers? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-06 21:17 +1000
              Re: How to turn a string into a list of integers? Kurt Mueller <kurt.alfred.mueller@gmail.com> - 2014-09-06 14:15 +0200
                Re: How to turn a string into a list of integers? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-07 04:19 +1000
                Re: How to turn a string into a list of integers? Kurt Mueller <kurt.alfred.mueller@gmail.com> - 2014-09-06 21:28 +0200
                Re: How to turn a string into a list of integers? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-07 11:47 +1000
                Re: How to turn a string into a list of integers? MRAB <python@mrabarnett.plus.com> - 2014-09-07 15:52 +0100
                Re: How to turn a string into a list of integers? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-08 03:02 +1000
                Re: How to turn a string into a list of integers? Rustom Mody <rustompmody@gmail.com> - 2014-09-07 10:53 -0700
                Re: How to turn a string into a list of integers? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-08 04:08 +1000
                Re: How to turn a string into a list of integers? Rustom Mody <rustompmody@gmail.com> - 2014-09-07 11:34 -0700
                Re: How to turn a string into a list of integers? Chris Angelico <rosuav@gmail.com> - 2014-09-08 10:14 +1000
                Re: How to turn a string into a list of integers? Marko Rauhamaa <marko@pacujo.net> - 2014-09-08 08:44 +0300
                Re: How to turn a string into a list of integers? Chris Angelico <rosuav@gmail.com> - 2014-09-08 15:53 +1000
                Re: How to turn a string into a list of integers? Terry Reedy <tjreedy@udel.edu> - 2014-09-08 03:41 -0400
                Re: How to turn a string into a list of integers? Chris Angelico <rosuav@gmail.com> - 2014-09-08 01:04 +1000
                Re: How to turn a string into a list of integers? Roy Smith <roy@panix.com> - 2014-09-07 11:40 -0400
                Re: How to turn a string into a list of integers? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-08 04:00 +1000
                Re: How to turn a string into a list of integers? Chris Angelico <rosuav@gmail.com> - 2014-09-08 10:12 +1000
              Re: How to turn a string into a list of integers? Chris Angelico <rosuav@gmail.com> - 2014-09-06 22:23 +1000
          Re: How to turn a string into a list of integers? Chris “Kwpolska” Warrick <kwpolska@gmail.com> - 2014-09-05 20:25 +0200
          Re: How to turn a string into a list of integers? Kurt Mueller <kurt.alfred.mueller@gmail.com> - 2014-09-05 21:16 +0200
          Re: How to turn a string into a list of integers? Kurt Mueller <kurt.alfred.mueller@gmail.com> - 2014-09-05 22:41 +0200
      Re: How to turn a string into a list of integers? Chris Angelico <rosuav@gmail.com> - 2014-09-05 10:12 +1000
      Re: How to turn a string into a list of integers? Ian Kelly <ian.g.kelly@gmail.com> - 2014-09-04 20:09 -0600
      Re: How to turn a string into a list of integers? Chris Angelico <rosuav@gmail.com> - 2014-09-05 12:15 +1000
        Re: How to turn a string into a list of integers? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-06 14:27 +1000
  Re: How to turn a string into a list of integers? obedrios@gmail.com - 2014-09-03 07:30 -0700

csiph-web