public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Albert Hopkins <marduk@letterboxes.org>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] package.keywords syntax?
Date: Thu, 30 Oct 2008 15:11:04 -0400	[thread overview]
Message-ID: <1225393864.14880.15.camel@brotherus.rdu.redhat.com> (raw)
In-Reply-To: <38af3d670810301154wea1382cj302f0965eb8fd59e@mail.gmail.com>

On Thu, 2008-10-30 at 16:54 -0200, Jorge Peixoto de Morais Neto wrote:
> > To back myself up:
> >
> > <file name="why_no.py">
> > #!/usr/bin/python
> >
> > import random
> >
> > for i in range(1,10000):
> >        if random.random() < 0.001:
> >                print "rare"
> >                if malformed < beast:
> >                        print "kick me in the ..."
> >        else:
> >                print "whatever"
> > </file>
> This kind of error is not a syntax error; this kind of error is indeed
> only discovered at runtime. However, syntax errors are discovered at
> byte-compile time. byte-compile happens automatically when you load a
> module, but you can perform it yourself easily, and this is
> recommended in certain situations.
> 
> For this kind of error (try to reference an undefined variable), there
> are tools like pychecker.
> 

I'm coming into this thread kinda late, so feel free to ignore...

... but Jorge is right.  This is easily picked up by a lint tool... and
good python programmers use them ;-).  Some python-aware editors even
have this functionality built in.

Using the above example:

        $ pylint who_no.py
        ...
        C:  1: Missing docstring
        C:  5: Comma not followed by a space
        for i in range(1,10000):
                        ^^
        E:  8: Undefined variable 'malformed'
        E:  8: Undefined variable 'beast'





  reply	other threads:[~2008-10-30 19:11 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-28 17:07 [gentoo-user] package.keywords syntax? Helmut Jarausch
2008-10-28 17:20 ` Neil Bothwick
2008-10-28 17:22 ` Andrey Vul
2008-10-28 17:39   ` Ricardo Saffi Marques
2008-10-28 17:49     ` Neil Bothwick
2008-10-28 20:29     ` Andrey Vul
2008-10-28 21:01       ` Alan McKinnon
2008-10-28 21:34         ` Jorge Peixoto de Morais Neto
2008-10-28 21:47           ` Robert Bridge
2008-10-28 21:56           ` Alan McKinnon
2008-10-28 22:17             ` Jorge Peixoto de Morais Neto
2008-10-28 22:41               ` Alan McKinnon
2008-10-28 22:55                 ` Jorge Peixoto de Morais Neto
2008-10-29  7:16                   ` Alan McKinnon
2008-10-29 14:16                     ` Andrey Vul
2008-10-29 20:13                     ` Jorge Peixoto de Morais Neto
2008-10-30 10:46                       ` Dirk Uys
2008-10-30 11:00                         ` Dirk Uys
2008-10-30 18:54                           ` Jorge Peixoto de Morais Neto
2008-10-30 19:11                             ` Albert Hopkins [this message]
2008-10-31  8:02                               ` Dirk Uys
2008-10-31  9:54                               ` [gentoo-user] OT: Python (was: package.keywords syntax?) Matthias Bethke
2008-10-31 10:31                                 ` Heiko Wundram
2008-10-30 19:12                         ` [gentoo-user] package.keywords syntax? Jorge Peixoto de Morais Neto
2008-10-31  7:57                           ` Dirk Uys

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1225393864.14880.15.camel@brotherus.rdu.redhat.com \
    --to=marduk@letterboxes.org \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox