From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1KvcvJ-0006CL-SF for garchives@archives.gentoo.org; Thu, 30 Oct 2008 19:11:14 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 578A5E02FD; Thu, 30 Oct 2008 19:11:12 +0000 (UTC) Received: from out3.smtp.messagingengine.com (out3.smtp.messagingengine.com [66.111.4.27]) by pigeon.gentoo.org (Postfix) with ESMTP id 36E3BE02FD for ; Thu, 30 Oct 2008 19:11:12 +0000 (UTC) Received: from compute2.internal (compute2.internal [10.202.2.42]) by out1.messagingengine.com (Postfix) with ESMTP id BD51D187CE2 for ; Thu, 30 Oct 2008 15:11:08 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Thu, 30 Oct 2008 15:11:08 -0400 X-Sasl-enc: sNlKC3WNm1aO7ZhB8E1v0QC6UBmcvWZ4lhPzizr1Fa0C 1225393868 Received: from [10.11.243.98] (nat-pool-rdu.redhat.com [66.187.233.202]) by www.fastmail.fm (Postfix) with ESMTPSA id 7A65F271F9 for ; Thu, 30 Oct 2008 15:11:08 -0400 (EDT) Subject: Re: [gentoo-user] package.keywords syntax? From: Albert Hopkins To: gentoo-user@lists.gentoo.org In-Reply-To: <38af3d670810301154wea1382cj302f0965eb8fd59e@mail.gmail.com> References: <200810290041.39256.alan.mckinnon@gmail.com> <38af3d670810281555j43a2c0dfl990860eb9b85921b@mail.gmail.com> <200810290916.29649.alan.mckinnon@gmail.com> <38af3d670810291313p7937d68ei55d2b6ff9b9df6ad@mail.gmail.com> <79e3aefb0810300346m19d36196x4f3ec748f6a14be3@mail.gmail.com> <79e3aefb0810300400o380f73f2q76dbb268c434fb5c@mail.gmail.com> <38af3d670810301154wea1382cj302f0965eb8fd59e@mail.gmail.com> Content-Type: text/plain Organization: Marduk Enterprises Date: Thu, 30 Oct 2008 15:11:04 -0400 Message-Id: <1225393864.14880.15.camel@brotherus.rdu.redhat.com> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 (2.22.3.1-1.fc9) Content-Transfer-Encoding: 7bit X-Archives-Salt: 77fbf37d-a538-4bf3-9099-6c2df7c3d51a X-Archives-Hash: 9b96571922a473ca9d90bdda9551c524 On Thu, 2008-10-30 at 16:54 -0200, Jorge Peixoto de Morais Neto wrote: > > To back myself up: > > > > > > #!/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" > > > 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'