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


Groups > comp.lang.python > #63322

Re: "More About Unicode in Python 2 and 3"

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <dreamingforward@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'argument': 0.05; 'output': 0.05; 'subject:Python': 0.06; 'binary': 0.07; 'debug': 0.07; 'elegant': 0.07; 'important,': 0.07; 'anymore.': 0.09; 'ascii': 0.09; 'mixed': 0.09; 'subset': 0.09; 'window.': 0.09; 'cc:addr :python-list': 0.11; 'python': 0.11; 'language,': 0.12; '1900': 0.16; 'be:': 0.16; 'before.': 0.16; 'subject:More': 0.16; 'subject:Unicode': 0.16; 'sync': 0.16; 'small,': 0.19; 'things.': 0.19; 'cc:addr:python.org': 0.22; 'bytes': 0.24; 'text.': 0.24; 'fine': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'went': 0.31; 'subject:About': 0.31; "can't": 0.35; 'no,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'are,': 0.36; 'shows': 0.36; 'window': 0.38; 'needed': 0.38; 'embedded': 0.39; 'skip:. 10': 0.39; 'either': 0.39; 'called': 0.40; 'subject:"': 0.60; 'course': 0.61; 'simple': 0.61; 'skip:n 10': 0.64; 'become': 0.64; 'reply': 0.66; '0000': 0.84; '0300': 0.84; '4500': 0.84; 'difficult,': 0.91
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 :cc:content-type; bh=Lfy+am5iptgxKX09yuwmpBihSrIFqajmEeh433ovcI4=; b=geUVJk/h3lFpVYisUeT5dacVNNR44VdNW6qjKo7z+039JiwirgYReEWDnQ9Kklm6Rh YCLwsS8Fay2qkOTVqOEqlmBcXhNeW1zKwHGKLdY2ihrUvUGJYhrcCK8otQadX4VN0WKt VeojHDcr8SjVlmEkcNu5KjoLcYGM77GbBwaU99JCxAPAEVQK5wWZ5kVl1d3FO87Wb+SJ mehrU5cbWJlXN8SqF/g2Q98p5StyWHVLi1niWTG6ONplVlMmTUM1ebZL9YmVAMg2A4Je 2Sa2K+XT0uWIEtTd12sj8fIHQyL4E2KiB5eqqxOJBHk0en6wLVwhD3JOnG+oLoLW34b3 Y2MQ==
MIME-Version 1.0
X-Received by 10.180.188.141 with SMTP id ga13mr13484505wic.55.1389036104333; Mon, 06 Jan 2014 11:21:44 -0800 (PST)
In-Reply-To <52CAC780.1010204@stoneleaf.us>
References <lablra$1mc$2@ger.gmane.org> <52C9FD02.3080109@stoneleaf.us> <CAGGBd_qBA0OBELxgzERO4Tfs6quK7oYq8v_2idA=K2ycoiO6Dg@mail.gmail.com> <52CAC780.1010204@stoneleaf.us>
Date Mon, 6 Jan 2014 13:21:44 -0600
Subject Re: "More About Unicode in Python 2 and 3"
From Mark Janssen <dreamingforward@gmail.com>
To Ethan Furman <ethan@stoneleaf.us>
Content-Type text/plain; charset=ISO-8859-1
Cc Python <python-list@python.org>
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.5043.1389036106.18130.python-list@python.org> (permalink)
Lines 33
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1389036106 news.xs4all.nl 2962 [2001:888:2000:d::a6]:60718
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:63322

Show key headers only | View raw


> The argument is that a very important, if small, subset a data manipulation
> become very painful in Py3.  Not impossible, and not difficult, but painful
> because the mental model and the contortions needed to get things to work
> don't sync up anymore.

You are confused.  Please see my reply to you on the bytestring type thread.

> Painful because Python is, at heart, a simple and
> elegant language, but with the use-case of embedded ascii in binary data
> that elegance went right out the window.

It went out the window only because the Object model with the
type/class unification was wrong.  It was fine before.

Mark

>> It can't be both things. It's either bytes or it's text.
>
> Of course it can be:
>
> 0000000: 0372 0106 0000 0000 6100 1d00 0000 0000  .r......a.......
> 0000010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
> 0000020: 4e41 4d45 0000 0000 0000 0043 0100 0000  NAME.......C....
> 0000030: 1900 0000 0000 0000 0000 0000 0000 0000  ................
> 0000040: 4147 4500 0000 0000 0000 004e 1a00 0000  AGE........N....
> 0000050: 0300 0000 0000 0000 0000 0000 0000 0000  ................
> 0000060: 0d1a 0a                                  ...
>
> And there we are, mixed bytes and ascii data.

No, you are printing a debug output which shows both.  That's called CHEATING.

Mark

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


Thread

Re: "More About Unicode in Python 2 and 3" Mark Janssen <dreamingforward@gmail.com> - 2014-01-06 13:21 -0600

csiph-web