Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'cache': 0.05; 'memory.': 0.05; 'alignment': 0.07; 'ascii': 0.07; 'subject:How': 0.09; 'python': 0.09; 'exists,': 0.09; 'splitting': 0.09; 'subject:()': 0.09; 'subject:string': 0.09; 'subject:using': 0.09; 'language,': 0.11; 'aug': 0.13; 'ascii,': 0.16; 'bits,': 0.16; 'elsewhere.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:unicode': 0.16; 'subject:variable': 0.16; 'string': 0.17; 'wrote:': 0.17; 'bytes': 0.17; 'comparing': 0.17; 'memory': 0.18; 'received:209.85.214.174': 0.21; 'regardless': 0.21; 'class.': 0.23; 'non': 0.24; 'header:In-Reply-To:1': 0.25; 'fit': 0.26; 'am,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'appending': 0.29; 'cpu': 0.29; 'strings,': 0.29; "i'm": 0.29; 'code': 0.31; '(and': 0.32; 'structure': 0.32; 'function.': 0.33; 'turns': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'compared': 0.35; 'too.': 0.35; 'received:209.85': 0.35; 'there': 0.35; 'tool': 0.36; 'but': 0.36; 'why': 0.37; 'detail': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'performance': 0.39; 'to:addr:python.org': 0.39; 'received:209.85.214': 0.39; 'space': 0.39; 'header:Received:5': 0.40; 'your': 0.60; "you'll": 0.62; 'more': 0.63; 'costs': 0.64; 'gone': 0.64; 'great': 0.64; 'everybody': 0.69; 'saving': 0.72; 'advantages.': 0.84; 'amazed': 0.84; 'packing': 0.84; 'presumably': 0.84; 'significance': 0.84; 'subject:value': 0.84; 'song.': 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 :content-type; bh=KJyxu18NmbmAM/2cOPdPWek05V0l/+Vh7tgj5mYObB0=; b=KE89cYTiWjclH2lMVCO1Zb4pQbUOlup6BZK2rBLuoRPCDKxJSIjknTJEy5Tlj3j5wl 9jw5bH5aoIWYK+rNzYLmPYr9R57ftocFJbchvY1d6Tb9P+deFEIOxgWCEjsFYla/fa0L aOOqhKkSJoX05speZKXhHKDyTstPZW1Hrymrxk34sLXDpkq+SodtxIm4FUs8pPHIXdRY LBJJ0DyuOZVisIlYqVHXaXvt53xiyux04qwXx0hQZtB7gYyn8/NfMw+n8+H82J8SQMFF zFh0itj+Ifefc0xsYvjFX9Dz1qIZdhGeG08tUmAYKeTNhGaxdGi2r82gACOkVtfHRJxs 4LQg== MIME-Version: 1.0 In-Reply-To: References: <308df2af-abe7-4043-b199-0a39f440e0ab@googlegroups.com> <502f8a2a$0$29978$c3e8da3$5496439d@news.astraweb.com> Date: Sun, 19 Aug 2012 01:36:01 +1000 Subject: Re: How do I display unicode value stored in a string variable using ord() 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.12 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: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1345304165 news.xs4all.nl 6967 [2001:888:2000:d::a6]:59013 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:27301 On Sun, Aug 19, 2012 at 1:07 AM, wrote: > I'm aware of this (and all the blah blah blah you are > explaining). This always the same song. Memory. > > Let me ask. Is Python an 'american" product for us-users > or is it a tool for everybody [*]? > Is there any reason why non ascii users are somehow penalized > compared to ascii users? Regardless of your own native language, "len" is the name of a popular Python function. And "dict" is a well-used class. Both those names are representable in ASCII, even if every quoted string in your code requires more bytes to store. And memory usage has significance in many other areas, too. CPU cache utilization turns a space saving into a time saving. That's why structure packing still exists, even though member alignment has other advantages. You'd be amazed how many non-USA strings still fit inside seven bits, too. Are you appending a space to something? Splitting on newlines? You'll have lots of strings that are going now to be space-optimized. Of course, the performance gains from shortening some of the strings may be offset by costs when comparing one-byte and multi-byte strings, but presumably that's all been gone into in great detail elsewhere. ChrisA