How to avoid PEP8 'imported but unused'

Adam Jiang jiang.adam at gmail.com
Sun May 5 22:47:57 EDT 2013


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



More information about the Python-list mailing list