#1307 Import errors from modules with dynamically created contents

closed-invalid
nobody
None
5
2011-11-10
2011-04-12
No

Python's dynamic nature makes static analysis of code more of a "good guess" than a conclusive scan.
For example:

from nose.tools import assert_raises

This causes an import error to be displayed because static analysis could not possibly determine that the module has such a variable.
Some workaround is necessary -- preferably a pragma in a comment or something, made available as a "quick fix" like in the JDT.

Discussion

  • Alex Grönholm

    Alex Grönholm - 2011-04-12
    • summary: Import errors from dynamically created modules --> Import errors from modules with dynamically created contents
     
  • Fabio Zadrozny

    Fabio Zadrozny - 2011-09-03
    • status: open --> pending
     
  • Fabio Zadrozny

    Fabio Zadrozny - 2011-09-03

    Actually, if you press ctrl+1 on that line it'll already provide an option to ignore it in that line, but still, have you tried adding 'nose' to the forced builtins (that may make the code-analysis work already).

    See: http://pydev.org/manual_101_interpreter.html for details.

     
  • Alex Grönholm

    Alex Grönholm - 2011-11-10

    I'll mark this invalid because there is already a solution like you pointed out. The reason I didn't figure it out myself is because quick fix doesn't work in pydev the way it works in JDT where you can just click on the marker and select "quick fix".

     
  • Alex Grönholm

    Alex Grönholm - 2011-11-10
    • status: pending --> closed-invalid
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks