Menu

#388 Globals by project

open
nobody
None
5
2009-09-30
2009-09-30
No

As Python is a very dynamic language it is not possible for the code analyser to find variables that are defined dynamical during runtime eg. globals. Therefore, PyDev already offers an option to define globals in options > window > preferences> pydev > pydev extensions > code analysis > undefined.

This could be improved:

1. Define globals by project.
2. Bigger multiline text box for easier input (if there are many globals in a project it can get very hard to keep track of them).
3. If the code analyser finds an undefined variable it should offer "add to project globals" as a quick fix.

(For further reference look at the post at: https://sourceforge.net/projects/pydev/forums/forum/293649/topic/3384671 )

Discussion

  • Nicolas Keller

    Nicolas Keller - 2009-10-01

    4. Accept wildcards: If a global "GLOB" holds other objects, up to now these objects have to be defined to. A solution would be, if wildcards are accepted: "GLOB.*"

     
  • Anonymous

    Anonymous - 2010-12-03

    This is seriously needed. I work in a framework where, at runtime of file X, it can be assumed that file A has already been run in the same namespace and has side-effected the globals.

    Thus, when I'm working on file X, I need PyDev to understand that the stuff from file A is already in the namespace - and to do analysis and completions appropriately.

    The existing "code analysis > undefined" workaround would require me to type out every name from file A, and does not allow for code completion.

    The best solution would be the ability to define, on a per-project basis, a set of files that can be assumed to have already run, and thus their global side effects are available for analysis/completion.

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.