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


Groups > comp.lang.python > #44796 > unrolled thread

Re: How to avoid PEP8 'imported but unused'

Started byAdam Jiang <jiang.adam@gmail.com>
First post2013-05-06 11:47 +0900
Last post2013-05-06 11:47 +0900
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: How to avoid PEP8 'imported but unused' Adam Jiang <jiang.adam@gmail.com> - 2013-05-06 11:47 +0900

#44796 — Re: How to avoid PEP8 'imported but unused'

FromAdam Jiang <jiang.adam@gmail.com>
Date2013-05-06 11:47 +0900
SubjectRe: How to avoid PEP8 'imported but unused'
Message-ID<mailman.1315.1367808493.3114.python-list@python.org>
Thank you. Problem solved.

/Adam
On Sun, May 05, 2013 at 06:27:44PM +0100, Fábio Santos wrote:
> That assert will never fail. If the symbol is not imported, the import
> statement raises ImportError. And actually "assert" makes sure that
> the value is not false-ish, not None/Null. And AFAIK a module object
> is *always* true.
> 
> > One more question. In this particular case it seems 'assert' should be
> > safe as a workaround, doesn't it?  'assert' will check if the symbol
> > is imported and not NULL. Is there side effect if I just applied this
> > rule as a generic one.
> >
> 
> --
> Fábio Santos

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web