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


Groups > comp.lang.python > #74728

Re: I need an idea for practise!

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
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; 'programmer': 0.03; 'syntax': 0.04; '*not*': 0.07; 'plenty': 0.07; '101': 0.09; 'ascii': 0.09; 'boundaries': 0.09; 'contexts': 0.09; 'highlighting': 0.09; 'sure,': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; '2.7': 0.14; 'thread': 0.14; '90s,': 0.16; '__future__': 0.16; 'competent': 0.16; 'components.': 0.16; 'different,': 0.16; 'directive': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'identifiers,': 0.16; 'identifiers;': 0.16; 'keyword,': 0.16; 'keywords)': 0.16; 'lexer': 0.16; 'non-ascii': 0.16; 'optional.': 0.16; 'think.': 0.16; 'token,': 0.16; 'applies': 0.16; 'thursday,': 0.16; 'language': 0.16; 'wrote:': 0.18; 'variable': 0.18; '(but': 0.19; 'differ': 0.19; 'subject:need': 0.19; 'cc:addr:python.org': 0.22; "aren't": 0.24; 'instance,': 0.24; 'cc:2**0': 0.24; "i've": 0.25; 'gets': 0.27; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'on,': 0.29; "doesn't": 0.30; 'characters': 0.30; 'message- id:@mail.gmail.com': 0.30; 'context,': 0.31; 'helpful.': 0.31; 'quite': 0.32; 'worked': 0.33; 'cases': 0.33; 'fri,': 0.33; 'totally': 0.33; 'sense': 0.34; 'knowledge': 0.35; 'agree': 0.35; 'something': 0.35; 'johnson': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; 'should': 0.36; 'half': 0.37; 'wrong': 0.37; 'pm,': 0.38; 'rather': 0.38; 'extremely': 0.39; 'sure': 0.39; 'even': 0.60; 'course.': 0.60; 'simple,': 0.60; 'truly': 0.60; 'ago.': 0.61; 'simple': 0.61; "you're": 0.61; 'back': 0.62; 'name': 0.63; 'july': 0.63; 'skip:n 10': 0.64; 'respect': 0.70; 'jul': 0.74; 'yourself': 0.78; '3.4': 0.84; 'colored': 0.84; 'confusing': 0.84; 'naturally.': 0.84; 'partially': 0.84; 'technically': 0.84; 'absolutely': 0.87; 'to:none': 0.92; 'constitute': 0.93; 'rick': 0.93
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:cc :content-type; bh=RH0hia1CT16GFfuPCVFLmeFFs0lOQShDLb7DYmFQRjk=; b=i6n3IBMQ/Fdoyx6shRVGbtb8/GxLfVNIzcJ0AHwco1Ju2G5V7mfmEyptk529Q/tXjV y2lOcfJ3q3Lxg0DCTjYI945Kb+wkWdoSwk2GOO2JYPbdq6r4+4c0zlvdmWOvNTeq3FiS dVudaPKlQEtc7h1yYVuqfmb1d583WkXnWQVIpK8BjNBzDltUJJ4bn/qztFXNfCyPSRXN dAEiFXWaJXY8GO3onMiRgZ+WmFfTmjYnG5sQ30Syn2jNVgZkz022fiMwGwJ4t3I81k+w a97LPzvW9hs11eNfPooafkWRIw/MV+bXFbIgL9o9bedn3JizL58Pq0AbtcWnsgxywf+1 264A==
MIME-Version 1.0
X-Received by 10.52.63.226 with SMTP id j2mr1671640vds.43.1405663216698; Thu, 17 Jul 2014 23:00:16 -0700 (PDT)
In-Reply-To <4ce425e1-4c51-4ad2-91a3-fbf3577bd1a9@googlegroups.com>
References <6239bcaa-828f-499b-936d-69d022bb94ac@googlegroups.com> <467108ec-19e7-4089-8d5f-53a80244adaf@googlegroups.com> <mailman.11933.1405617616.18130.python-list@python.org> <b38e352c-e125-46ca-af04-3e0de345009a@googlegroups.com> <mailman.11974.1405649023.18130.python-list@python.org> <a6a835d3-e39a-4a06-b6e9-e8370152a4fd@googlegroups.com> <mailman.11979.1405653833.18130.python-list@python.org> <4ce425e1-4c51-4ad2-91a3-fbf3577bd1a9@googlegroups.com>
Date Fri, 18 Jul 2014 16:00:16 +1000
Subject Re: I need an idea for practise!
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.11985.1405663220.18130.python-list@python.org> (permalink)
Lines 56
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1405663220 news.xs4all.nl 2908 [2001:888:2000:d::a6]:49075
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:74728

Show key headers only | View raw


On Fri, Jul 18, 2014 at 2:06 PM, Rick Johnson
<rantingrickjohnson@gmail.com> wrote:
> On Thursday, July 17, 2014 10:23:50 PM UTC-5, Chris Angelico wrote:
>> And be sure *not* to colorize built-ins (but *do* colorize
>> keywords) in contexts where the tokens are actually
>> identifiers, like "x.open = 1".
>
> Just check for word boundaries on all your keywords and
> built-ins and you're *DONE*!

Of course, because (True.real) is just as much not-a-keyword as
(real.True), naturally.

>> Plus, if you want this to be truly general, you need to
>> have it understand that some keywords aren't keywords if
>> the shebang is different, although with 2.7 vs 3.4 that
>> only really applies to nonlocal (if True/False/None are
>> colored as keywords even though they're technically
>> builtins, that's not a big deal); if you want to support
>> Python 2.5, you'd also have to cope with a __future__
>> directive adding a keyword, but that's quite optional.
>> It's not as simple as you might think.
>
> Stop it, you're embarrassing yourself with all this rambling!
>
> You should have shut up a long time ago. Just like the
> thread where you embarrassed yourself with your limited
> knowledge of IDLE[1] and Tkinter, you're now really loosing
> all respect as a competent programmer if you cannot even
> write these "simple" regexps.

Simple regexps that differ in one tiny part based on something way
earlier? Sure, they're simple in the sense that you can devolve them
into very simple components. By the same token, all Python programs
are simple, because there are only 101 opcodes. Doesn't make it
readable.

>> I've worked with plenty of syntax highlighters that get
>> something wrong in some context, and it's extremely
>> annoying; in some cases it makes the colorization actually
>> harmful, rather than helpful. And it's absolutely
>> *essential* that the lexer and the language agree on, for
>> instance, what characters constitute identifiers; if I
>> have a partially non-ASCII variable name and only the
>> ASCII half of it gets highlighted, that can be highly
>> distracting.
>
> Oh i get it now, your confusing Python with REXX again...
>
>     *face palm*

I am? Oh right, because REXX totally has non-ASCII variable names, and
because I was always using syntax highlighting back in the 90s, but I
don't do it now. Of course.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

I need an idea for practise! Nicholas Cannon <nicholascannon1@gmail.com> - 2014-07-17 02:59 -0700
  Re: I need an idea for practise! alister <alister.nospam.ware@ntlworld.com> - 2014-07-17 10:13 +0000
  Re: I need an idea for practise! Abhiram R <abhi.darkness@gmail.com> - 2014-07-17 19:03 +0530
  Re: I need an idea for practise! Chris Angelico <rosuav@gmail.com> - 2014-07-18 00:20 +1000
  Re: I need an idea for practise! Rick Johnson <rantingrickjohnson@gmail.com> - 2014-07-17 09:34 -0700
    Re: I need an idea for practise! Chris Angelico <rosuav@gmail.com> - 2014-07-18 03:20 +1000
      Re: I need an idea for practise! Rick Johnson <rantingrickjohnson@gmail.com> - 2014-07-17 12:30 -0700
        Re: I need an idea for practise! Paul McNett <paul@mcnettware.com> - 2014-07-17 13:21 -0700
        Re: I need an idea for practise! Chris Angelico <rosuav@gmail.com> - 2014-07-18 12:03 +1000
          Re: I need an idea for practise! Rick Johnson <rantingrickjohnson@gmail.com> - 2014-07-17 20:07 -0700
            Re: I need an idea for practise! Chris Angelico <rosuav@gmail.com> - 2014-07-18 13:23 +1000
              Re: I need an idea for practise! Rick Johnson <rantingrickjohnson@gmail.com> - 2014-07-17 21:06 -0700
                Re: I need an idea for practise! Chris Angelico <rosuav@gmail.com> - 2014-07-18 16:00 +1000
    Re: I need an idea for practise! Terry Reedy <tjreedy@udel.edu> - 2014-07-17 17:46 -0400
    Re: I need an idea for practise! Chris Angelico <rosuav@gmail.com> - 2014-07-18 12:04 +1000
  Re: I need an idea for practise! Orochi <kartikjagdale11@gmail.com> - 2014-07-17 11:05 -0700
    Re: I need an idea for practise! AudreyJean <iamAudreyJean@gmail.com> - 2014-07-18 08:42 -0700
  Re: I need an idea for practise! Nicholas Cannon <nicholascannon1@gmail.com> - 2014-07-17 19:03 -0700

csiph-web