Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #44796 > unrolled thread
| Started by | Adam Jiang <jiang.adam@gmail.com> |
|---|---|
| First post | 2013-05-06 11:47 +0900 |
| Last post | 2013-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.
Re: How to avoid PEP8 'imported but unused' Adam Jiang <jiang.adam@gmail.com> - 2013-05-06 11:47 +0900
| From | Adam Jiang <jiang.adam@gmail.com> |
|---|---|
| Date | 2013-05-06 11:47 +0900 |
| Subject | Re: 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
Back to top | Article view | comp.lang.python
csiph-web