Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!newsfeed.xs4all.nl!newsfeed4.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'insert': 0.05; 'motivated': 0.05; 'output': 0.05; 'string.': 0.05; '(b)': 0.07; 'plenty': 0.07; 'preference': 0.07; 'removes': 0.07; 'responding': 0.07; 'string': 0.09; 'append': 0.09; 'pep': 0.09; 'preferable': 0.09; 'python': 0.11; 'gui': 0.12; "wouldn't": 0.14; '24,': 0.16; 'cons': 0.16; 'editor,': 0.16; 'immutable,': 0.16; 'keypress': 0.16; 'rebuilding': 0.16; 'string).': 0.16; 'task.': 0.16; 'undo': 0.16; 'usage,': 0.16; 'widgets.': 0.16; 'wxpython': 0.16; 'wrote:': 0.18; 'do.': 0.18; 'library': 0.18; 'wed,': 0.18; 'trying': 0.19; "python's": 0.19; 'split': 0.19; 'thu,': 0.19; 'widget': 0.19; 'written': 0.21; 'input': 0.22; '(a)': 0.24; 'choices': 0.24; 'simpler': 0.24; "i've": 0.25; 'gets': 0.27; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'wondering': 0.29; 'chris': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; '(which': 0.31; 'code': 0.31; '25,': 0.31; 'argue': 0.31; 'embedding': 0.31; 'operations.': 0.31; 'quite': 0.32; 'text': 0.33; 'implemented': 0.33; 'could': 0.34; 'created': 0.35; 'editor': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'doubt': 0.36; "he's": 0.36; 'opposed': 0.36; 'possible': 0.36; 'wrong': 0.37; 'list': 0.37; 'rich': 0.38; 'to:addr:python-list': 0.38; 'issue': 0.38; 'structure': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'even': 0.60; 'above,': 0.60; 'most': 0.60; 'new': 0.61; 'entire': 0.61; 'course': 0.61; 'simply': 0.61; 'times': 0.62; "you've": 0.63; 'personal': 0.63; 'myself': 0.63; 'more': 0.64; 'different': 0.65; 'finally': 0.65; 'here': 0.66; 'feeling': 0.68; 'pro': 0.69; 'stated': 0.69; 'receive': 0.70; 'therefore': 0.72; 'jul': 0.74; 'difference.': 0.84; "else's": 0.84; 'cognitive': 0.91; 'response,': 0.91; 'imagine': 0.93; '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=AV3WMWPwlSQuXbHIOEYWcjdGTnNJfQ8rvlJcraV4dKA=; b=X6gDjT7i49JB2QMEAxNfsl07/FAA9Z3EJ7HLALpbpy4g7b9vLGM8wxFotQTcBQik+q geBrP7BCR5NqD1LEP41Des0+OB5sJYSQxvrFWxAnpwBC9kCyw2OVyWj6Ldcx3oBBnPHP tTtdCDK66duiJjaEpQzeDLlrB490m4/Eg3bYkjlWTdGX8Gd0IoBcqO8F4fCux18p9N9r ce+LuweyiHAqnFt/s5fxJ84hEbEhXB4zlvATys1qqkziTpk0i6j5M+p/C2GOZXQPf9Nz 31UBEvfMAk861bfc0n5UlBrpRjrRcfQb8st9m56NHMKSPNXDK50yUlyq+chH82MYamEy 8BYA== X-Received: by 10.68.29.2 with SMTP id f2mr50174375pbh.184.1374785630216; Thu, 25 Jul 2013 13:53:50 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <571a6dfe-fd66-42cf-92fc-8b97cbe6e9e4@googlegroups.com> <51DFDE65.5040001@Gmail.com> <4f1067f6-bc99-42ad-9166-37fb228b90e8@googlegroups.com> From: Ian Kelly Date: Thu, 25 Jul 2013 15:53:10 -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: 42 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1374785634 news.xs4all.nl 15932 [2001:888:2000:d::a6]:37879 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:51259 On Wed, Jul 24, 2013 at 9:34 AM, Chris Angelico wrote: > On Thu, Jul 25, 2013 at 12:17 AM, David Hutto wrote: >> I've screwed up plenty of times in python, but can write code like a pro >> when I'm feeling better(on SSI and medicaid). An editor can be built simply, >> but it's preference that makes the difference. Some might have used tkinter, >> gtk. wxpython or other methods for the task. >> >> I think the main issue in responding is your library preference, or widget >> set preference. These can make you right with some in your response, or >> wrong with others that have a preferable gui library that coincides with >> one's personal cognitive structure that makes t > > jmf's point is more about writing the editor widget (Scintilla, as > opposed to SciTE), which most people will never bother to do. I've > written several text editors, always by embedding someone else's > widget, and therefore not concerning myself with its internal string > representation. Frankly, Python's strings are a *terrible* internal > representation for an editor widget - not because of PEP 393, but > simply because they are immutable, and every keypress would result in > a rebuilding of the string. On the flip side, I could quite plausibly > imagine using a list of strings; whenever text gets inserted, the > string gets split at that point, and a new string created for the > insert (which also means that an Undo operation simply removes one > entire string). In this usage, the FSR is beneficial, as it's possible > to have different strings at different widths. > > But mainly, I'm just wondering how many people here have any basis > from which to argue the point he's trying to make. I doubt most of us > have (a) implemented an editor widget, or (b) tested multiple > different internal representations to learn the true pros and cons of > each. And even if any of us had, that still wouldn't have any bearing > on PEP 393, which is about applications, not editor widgets. As stated > above, Python strings before AND after PEP 393 are poor choices for an > editor, ergo arguing from that standpoint is pretty useless. Not that > that bothers jmf... I think you've just motivated me to finally get around to writing the custom output widget for my MUD client. Of course that will be simpler than a standard rich text editor widget, since it will never receive input from the user and modifications will (typically) always come in the form of append operations. I intend to write it in pure Python (well, wxPython), however.