Hi.

I found an error in pydev Code Analyser.

The following code works perfectly, and the pydev Code Analysis also parse this 
file without problem.

  class TestConstants:
      DICT1                 = {'id':1}
      DICT2                 = {'id':2}
      LIST_OF_DICTS         = ["DICT1", "DICT2"]  

  for testName in TestConstants.LIST_OF_DICTS:
      print(TestConstants.__dict__[testName])


Unfortunately when we split this code, into two separate files, and we add 
import, the pydev CodeAnalyser is displaying error (python code works 
correclty):

FILE01:
  class TestConstants:
      DICT1                 = {'id':1}
      DICT2                 = {'id':2}
      LIST_OF_DICTS         = ["DICT1", "DICT2"]  

FILE02:
  from Constants import TestConstants

  for testName in TestConstants.LIST_OF_DICTS:
      print(TestConstants.__dict__[testName])

The full source code is in attachment.
Is it possible to fix this error, or it too complicated to fix it?

Thanks in advance
Bartosz
class TestConstants:
    DICT1                 = {'id':1}
    DICT2                 = {'id':2}
    LIST_OF_DICTS         = ["DICT1", "DICT2"]      

from Constants import TestConstants

#class TestConstants:
#    DICT1                 = {'id':1}
#    DICT2                 = {'id':2}
#    LIST_OF_DICTS         = ["DICT1", "DICT2"]      
    

for testName in TestConstants.LIST_OF_DICTS:
    something = TestConstants.__dict__[testName]
    
------------------------------------------------------------------------------
Systems Optimization Self Assessment
Improve efficiency and utilization of IT resources. Drive out cost and 
improve service delivery. Take 5 minutes to use this Systems Optimization 
Self Assessment. http://www.accelacomm.com/jaw/sdnl/114/51450054/
_______________________________________________
pydev-code mailing list
pydev-code@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pydev-code

Reply via email to