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


Groups > comp.lang.python > #63189 > unrolled thread

"More About Unicode in Python 2 and 3"

Started byMark Lawrence <breamoreboy@yahoo.co.uk>
First post2014-01-05 13:14 +0000
Last post2014-01-08 23:53 +0000
Articles 4 — 3 participants

Back to article view | Back to comp.lang.python


Contents

  "More About Unicode in Python 2 and 3" Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-01-05 13:14 +0000
    Re: "More About Unicode in Python 2 and 3" rdsteph@mac.com - 2014-01-08 15:34 -0800
      Re: "More About Unicode in Python 2 and 3" Chris Angelico <rosuav@gmail.com> - 2014-01-09 10:45 +1100
      Re: "More About Unicode in Python 2 and 3" Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-01-08 23:53 +0000

#63189 — "More About Unicode in Python 2 and 3"

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2014-01-05 13:14 +0000
Subject"More About Unicode in Python 2 and 3"
Message-ID<mailman.4942.1388927706.18130.python-list@python.org>
http://lucumr.pocoo.org/2014/1/5/unicode-in-2-and-3/

Please don't shoot the messenger :)

-- 
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.

Mark Lawrence

[toc] | [next] | [standalone]


#63535

Fromrdsteph@mac.com
Date2014-01-08 15:34 -0800
Message-ID<ad02bdfe-ef6e-4e2f-950f-d28fe62f5139@googlegroups.com>
In reply to#63189
I'm so sorry for the mess in my post above, I apologize to all, I accidentally hit return ...

I just meant to say that internet programming using ASCII urls is so common and important that it hurts that Python 3 makes it so much harder. It sure would be great if Python 3 could be improved to allow such programming to be done using ASCII urls without requiring all the unicode overhead.

Armin is right. Calling his post a rant doesn't help.

[toc] | [prev] | [next] | [standalone]


#63537

FromChris Angelico <rosuav@gmail.com>
Date2014-01-09 10:45 +1100
Message-ID<mailman.5208.1389224741.18130.python-list@python.org>
In reply to#63535
On Thu, Jan 9, 2014 at 10:34 AM,  <rdsteph@mac.com> wrote:
> I just meant to say that internet programming using ASCII urls is so common and important that it hurts that Python 3 makes it so much harder. It sure would be great if Python 3 could be improved to allow such programming to be done using ASCII urls without requiring all the unicode overhead.
>
> Armin is right. Calling his post a rant doesn't help.

There's one big problem with that theory. We've been looking, on this
list and on python-ideas, at some practical suggestions for adding
something to Py3 that will help. So far, lots of people have suggested
things, and the complainers haven't attempted to explain what they
actually need. Hard facts and examples would help enormously.

Incidentally, before referring to "all the Unicode overhead", it would
help to actually measure the overhead of encoding and decoding.

Python 2.7:
>>> timeit.timeit("a.encode().decode()","a=u'a'*1000",number=500000)
8.787162614242874

Python 3.4:
>>> timeit.timeit("a.encode().decode()","a=u'a'*1000",number=500000)
1.7354552045022515

Since 3.3, the cost of UTF-8 encoding/decoding an all-ASCII string is
extremely low. So the real cost isn't in run-time performance but in
code complexity. Would it be easier to work with ASCII URLs with a
one-letter-name helper function? I never got an answer to that
question.

ChrisA

[toc] | [prev] | [next] | [standalone]


#63539

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2014-01-08 23:53 +0000
Message-ID<mailman.5211.1389225233.18130.python-list@python.org>
In reply to#63535
On 08/01/2014 23:34, rdsteph@mac.com wrote:
> I'm so sorry for the mess in my post above, I apologize to all, I accidentally hit return ...
>
> I just meant to say that internet programming using ASCII urls is so common and important that it hurts that Python 3 makes it so much harder. It sure would be great if Python 3 could be improved to allow such programming to be done using ASCII urls without requiring all the unicode overhead.
>
> Armin is right. Calling his post a rant doesn't help.
>

I disagree.  If you want to make friends and influence people, your 
opening sentence is not "It's becoming increasingly harder to have 
reasonable discussions about the differences between Python 2 and 3 
because one language is dead and the other is actively developed."  If 
Python 2 is dead, why are the core developers wasting their time 
committing patches to the Python 2 source code, because they have 
nothing better to do?

-- 
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.

Mark Lawrence

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web