Path: csiph.com!usenet.pasdenom.info!news.franciliens.net!news.muarf.org!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3.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.013 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'string.': 0.05; 'utf-8': 0.07; 'string': 0.09; "'a'": 0.09; 'ascii': 0.09; 'bytes,': 0.09; 'strings.': 0.09; 'variant': 0.09; 'python': 0.11; '"to': 0.16; '8-bit': 0.16; 'byte,': 0.16; 'encodings': 0.16; 'exist.': 0.16; 'rather,': 0.16; 'wrote:': 0.18; 'thu,': 0.19; '>>>': 0.22; '(or': 0.24; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'character': 0.29; "doesn't": 0.30; 'characters': 0.30; 'message- id:@mail.gmail.com': 0.30; '+0100,': 0.31; '25,': 0.31; '>>>>': 0.31; "d'aprano": 0.31; 'explained': 0.31; 'steven': 0.31; 'text': 0.33; 'fri,': 0.33; 'except': 0.35; 'editor': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'described': 0.36; 'sequence': 0.36; 'possible': 0.36; 'example,': 0.37; 'to:addr :python-list': 0.38; 'pm,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'users': 0.40; 'numbers': 0.61; "you've": 0.63; 'such': 0.63; 'happen': 0.63; 'different': 0.65; 'within': 0.65; '26,': 0.68; 'therefore': 0.72; 'jul': 0.74; 'characters,': 0.84; 'presumably': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=Nsm6z8agfNJqfurxA1RdYjuMpkrvpGKbP2H9Svj9UsQ=; b=FFnWhIjo6gcOkw8tLaFmGYuj3WKN5Rx0fmUkgNtu7eBtrqWuoESn3+tGuYWCpfRM6a MKziGBLWuieD8sN9xzs/9nZ4URAMV/MQseXCVi22HvCJfyunqZ/3e/+XvuZ0DDCu038d 7pdSm/uTxT2Gg2Pm1giGqeE9LWSK+y23JxFEreJXbeiwdsBAzUGpWxCNvppFHFKko0wM F+J8n74tF78CwDdu9WKKtrUp+t6/JhPJ+NRTfSlGfQKrHvKV06eZ9t0WJTTMgfJVx68O ZpJ6M5j4FSdoWn3eY8/Oq1z3/BtmDfV10S7I5iqjFKZ7e1CkfV27R5SHbKyE9AU2qcRB tFeQ== X-Received: by 10.68.129.138 with SMTP id nw10mr18111658pbb.158.1374785178694; Thu, 25 Jul 2013 13:46:18 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <51f15e03$0$29971$c3e8da3$5496439d@news.astraweb.com> References: <571a6dfe-fd66-42cf-92fc-8b97cbe6e9e4@googlegroups.com> <51DFDE65.5040001@Gmail.com> <4f1067f6-bc99-42ad-9166-37fb228b90e8@googlegroups.com> <51f14395$0$29971$c3e8da3$5496439d@news.astraweb.com> <51f15e03$0$29971$c3e8da3$5496439d@news.astraweb.com> From: Ian Kelly Date: Thu, 25 Jul 2013 15:45:38 -0500 Subject: Re: RE Module Performance To: Python Content-Type: text/plain; charset=ISO-8859-1 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: 36 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1374785646 news.xs4all.nl 15865 [2001:888:2000:d::a6]:38049 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:51260 On Thu, Jul 25, 2013 at 12:18 PM, Steven D'Aprano wrote: > On Fri, 26 Jul 2013 01:36:07 +1000, Chris Angelico wrote: > >> On Fri, Jul 26, 2013 at 1:26 AM, Steven D'Aprano >> wrote: >>> On Thu, 25 Jul 2013 14:36:25 +0100, Jeremy Sanders wrote: >>>> "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[1]. For example, >>>> any ASCII character takes up only 1 byte, a Latin-1 character takes up >>>> 2 bytes, etc. We call this representation of text multibyte. >>> >>> Well, you've just proven what Vim users have always suspected: Emacs >>> doesn't really exist. >> >> ... lolwut? > > > JMF has explained that it is impossible, impossible I say!, to write an > editor using a flexible string representation. Since Emacs uses such a > flexible string representation, Emacs is impossible, and therefore Emacs > doesn't exist. > > QED. Except that the described representation used by Emacs is a variant of UTF-8, not an FSR. It doesn't have three different possible encodings for the letter 'a' depending on what other characters happen to be in the string. As I understand it, jfm would be perfectly happy if Python used UTF-8 (or presumably the Emacs variant) as its internal string representation.