Menu

#1549 Incorrect undefined variable and undefined import errors

open
nobody
None
5
2013-01-08
2013-01-08
No

I have a Python project ( https://github.com/astropy/astroquery ) where I get incorrect "undefined variable" errors in astroquery/simbad/sim_queries.py .

To illustrate the problem I made a small PyDev test project with an empty __init__.py file and these two files:

------------------------------

# one.py
__all__ = ('AClass', '_BClass')
class AClass:
pass
class _BClass:
pass

------------------------------

# two.py
from .one import *
AClass()
_BClass()

------------------------------

I get these two incorrect errors reported by PyDev:

Description Resource Path Location Type
Undefined variable: _BClass two.py /pydev_test_package line 3 PyDev Problem
Unresolved import: one two.py /pydev_test_package line 0 PyDev Problem

Can you reproduce?

Discussion

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.