Posted 8 years ago by mpl
Version: 16.1.0633
Avatar

I'm not sure if I am doing something wrong, or doing something unsupported. I am using 2016.1.0633. Consider the following example:

# employee.py
def create_employee(name, id):
    return Employee(name, id)

class Employee(object):
    def __init__(self, name, id):
        self._name = name
        self._id = id
        
    def get_name(self):
        return self._name
    
    def get_id(seld):
        return self._id

 

# manager.py
import employee

emp = employee.create_employee("Alice", 1)
print(emp.get_name())  # IntelliPrompt does NOT show employee methods
 
assert isinstance(emp, employee.Employee)
print(emp.get_name())  # IntelliPrompt does NOT show employee methods
 
emp2 = employee.Employee("Bob", 2)
print(emp2.get_name())  # IntelliPrompt does show employee methods

 I am not sure if I can, and how to, get intelliprompt to work in either of the first two scenaros. Any help would be much appreciated. Thank you!

[Modified 8 years ago]

Comments (1)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

Yes that is a limitation of the resolver.  In the third scenario, you are constructing the exact module and class, so it knows what methods are available.  In the other two scenarios, its having to see what the result of a method is.  But the resolver is only capable of resolving method results that are simple primitive types at this time.  While your example is simpler, there are generally much more complex method implementations that cause ambiguous result scenarios for the resolver to handle.


Actipro Software Support

The latest build of this product (v24.1.3) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.