Re: How to avoid PEP8 'imported but unused'

Discussion in 'Python' started by Fábio Santos, May 5, 2013.

  1. 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
    Fábio Santos, May 5, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Adam Jiang
    Replies:
    0
    Views:
    87
    Adam Jiang
    May 5, 2013
  2. Fábio Santos

    Re: How to avoid PEP8 'imported but unused'

    Fábio Santos, May 5, 2013, in forum: Python
    Replies:
    0
    Views:
    100
    Fábio Santos
    May 5, 2013
  3. MRAB
    Replies:
    0
    Views:
    93
  4. Peter Otten
    Replies:
    0
    Views:
    91
    Peter Otten
    May 5, 2013
  5. Adam Jiang
    Replies:
    0
    Views:
    79
    Adam Jiang
    May 5, 2013
Loading...

Share This Page