I tested many Python IDEs for their code completion capabilities. Is there one that can complete code completion in the following case:
def foo(x):
print x.read() // remove this line, and type in "print x."
def main():
n = open("c:\\python27\\test.py");
foo(n)
The IDE should find out that foo is called somewhere in the current module with a parameter that was the return value from the open () call that it would have to accept, is a call file.openand thus returns a file object. Thus, x.followed by Ctrl + Space, code completion is invoked and it is shown that x, as a file object, can support any method of a file object, including read().
I found that PyScripter, for example, can do this:
n = open("c:\\python27\\test.py");
n.
, PyScripter , , n , , , , .
-, Python 2.x , Python 3.x, , , IDE?
def foo(x:'file'):
print x.read() // remove this line, and type in "print x." and hit ctrl+space