I have a python project where some globals are set when the program starts. How can I teach pydev's source code analysis that these globals are set in my project even when they are not set in the current source file?
I see that I can set forced builtins - but if I add my global objects there, they are recognized by code completion but still produce errors in code analysis. Did I misunderstood forced builtins? Let me give you a short example:
First File (called first):
__builtin__.__dict__['DEMO'] = DEMO
Second file (called later):
demo = DEMO()
How can I tell pydevs source code analysis that DEMO exists as a global in the current project and where to look for DEMO (without an actual import statement in the second file)?
You have to ad it at window > preferences> pydev > pydev extensions > code analysis > undefined.
Hi Fabio, thank you for the quick response. Your solution works, but it's a little bit ugly, because I have lots of these globals and just in one project. Could you consider an option defining this by project or even an option to keep this globals in an external file / structure?
Please enter that as a feature request.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.