Path: csiph.com!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'string.': 0.05; 'utf-8': 0.07; 'string': 0.09; 'ascii': 0.09; 'bytes,': 0.09; 'character,': 0.09; 'encode': 0.09; 'mixed': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'strings.': 0.09; 'python': 0.11; '8-bit': 0.16; '>the': 0.16; 'byte,': 0.16; 'message-id:@4ax.com': 0.16; 'rather,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'pointed': 0.19; "python's": 0.19; 'byte': 0.24; 'bytes': 0.24; 'specify': 0.24; 'url:home': 0.24; 'header:X-Complaints-To:1': 0.27; 'character': 0.29; "doesn't": 0.30; 'characters': 0.30; 'statement': 0.30; 'largest': 0.30; "d'aprano": 0.31; 'steven': 0.31; 'text': 0.33; 'minimal': 0.33; 'sequence': 0.36; 'charset:us-ascii': 0.36; "i'll": 0.36; 'example,': 0.37; 'received:76': 0.38; 'to:addr:python-list': 0.38; 'does': 0.39; 'quote': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'read': 0.60; 'length': 0.61; 'numbers': 0.61; 'entire': 0.61; 'first': 0.61; 'within': 0.65; 'between': 0.67; 'jul': 0.74; 'characters,': 0.84; '2013': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: RE Module Performance Date: Sat, 27 Jul 2013 12:13:39 -0400 Organization: IISS Elusive Unicorn References: <51f14395$0$29971$c3e8da3$5496439d@news.astraweb.com> <51f15e03$0$29971$c3e8da3$5496439d@news.astraweb.com> <51f1e371$0$29971$c3e8da3$5496439d@news.astraweb.com> <51f3406f$0$29971$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-76-249-21-36.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 38 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1374941632 news.xs4all.nl 15993 [2001:888:2000:d::a6]:54961 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:51366 On 27 Jul 2013 03:37:20 GMT, Steven D'Aprano declaimed the following: >I disagree, and so does Jeremy Sanders who first pointed out the >similarity between Emacs' UTF-8 and Python's FSR. I'll quote from the >Emacs documentation again: > >"To conserve memory, Emacs does not hold fixed-length 22-bit numbers that >are codepoints of text characters within buffers and strings. Rather, >Emacs uses a variable-length internal representation of characters, that >stores each character as a sequence of 1 to 5 8-bit bytes, depending on >the magnitude of its codepoint. For example, any ASCII character takes >up only 1 byte, a Latin-1 character takes up 2 bytes, etc." > >And the Python FSR: > >"To conserve memory, Python does not hold fixed-length 21-bit numbers that >are codepoints of text characters within buffers and strings. Rather, >Python uses a variable-length internal representation of characters, that >stores each character as a sequence of 1 to 4 8-bit bytes, depending on >the magnitude of the largest codepoint in the string. For example, any >all-ASCII or all-Latin1 string takes up only 1 byte per character, an all- >BMP string takes up 2 bytes per character, etc." > As I read those: Python states "any all-ASCII or all-Latin1 string takes up only 1 byte per character", etc. IE; the entire STRING is based upon the minimal size that can encode all characters in the string. The EMACS statement doesn't specify a "string", it implies, in "any ASCII character takes up only 1 byte, a Latin-1 character takes up 2 bytes, etc.", that a string can contain mixed length characters. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/