[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Assertions that are always true



It's a mistake to write

     assert(tilsit, 'Never at the end of the week, sir.')

instead of

     assert tilsit, 'Never at the end of the week, sir.'

The former assertion is always true, and thus no-op. Python >= 2.6 emits a SyntaxWarning about this.

I implemented lintian4python check for such issues and ran it against all packages in (somewhat out of date) unstable. The results are attached.

Any volunteers to file bugs?

--
Jakub Wilk
Andrew Pollock <apollock@debian.org>
   pymetrics

Debian freesmartphone.org Team <pkg-fso-maint@lists.alioth.debian.org>
   fso-frameworkd

Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
   python-myghty

Debian QA Group <packages@qa.debian.org>
   gdesklets
   python-toscawidgets

Debichem Team <debichem-devel@lists.alioth.debian.org>
   python-rdkit

Joachim Breitner <nomeata@debian.org>
   fso-frameworkd (U)

Luca Capello <luca@pca.it>
   fso-frameworkd (U)

Michael Banck <mbanck@debian.org>
   python-rdkit (U)

Oleksandr Moskalenko <malex@debian.org>
   python-myghty (U)

Rico Rommel <rico@bierrommel.de>
   fso-frameworkd (U)

Sebastian Reichel <sre@debian.org>
   fso-frameworkd (U)

Toni Mueller <toni@debian.org>
   roundup


Reply to: