#1489 error highlighting broken with assigned classes via methods

closed-works-for-me
Editor (491)
5
2012-03-29
2012-03-28
Luke
No

I have a situation where I am assigning a class via a method:

class tests(unittest.TestCase):

def objectFactory(self):
return TestObject()

def test_CtrlOne(self):
testObject = self.objectFactory()
testObject.unimplementedMethod() <- no error highlighting here
pass

Discussion

  • Fabio Zadrozny

    Fabio Zadrozny - 2012-03-29
    • status: open --> closed-works-for-me
     
  • Fabio Zadrozny

    Fabio Zadrozny - 2012-03-29

    The current behavior is expected. PyDev will only check dotted names that complement an import (i.e.: not from a class). This is a current limitation of the code analysis.

    Also, given the current code, it should say that TestObject is undefined, so, as it's not there, there wouldn't be a way to saying that unimplementedMethod is not part of a class that wasn't found in the first place (note that if it was found, if you did Ctrl+1 there, it should still be able to give a suggestion to create a method at that class).

    If I misunderstood something there, please reopen this bug.