In the PyDev perspective, if I open a file or pipe, such as:
f = open("somefile.text")
p = os.popen("ls -al *.text")
and then try to type f.read() or p.readlines(), auto-completion does not engage as expected to display the appropriate class methods after I type the '.' after the object name.
What is presented in the auto-completion drop-down instead is a list of the parent class methods for anything derived from 'object' (such as __str__, __cmp__, etc.), and, mercifully, an option for method calls that I had manually invoked previously, i.e. whatever it remembered in that object's call history.
Notably, if I start a new line and type 'file.', the appropriate methods appear in the auto-completion drop-down (close(), flush(), etc.).
I would expect that the auto-completion would also readily display read(), readlines(), close(), etc. for any object returned from an open() or popen().
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Please enter that as a bug request (the problem is that PyDev can't really call your code to know what a method would return, but this specific use-case could be hard-coded - it works for file because it's a class, not a method).
Cheers,
Fabio
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In the PyDev perspective, if I open a file or pipe, such as:
f = open("somefile.text")
p = os.popen("ls -al *.text")
and then try to type f.read() or p.readlines(), auto-completion does not engage as expected to display the appropriate class methods after I type the '.' after the object name.
What is presented in the auto-completion drop-down instead is a list of the parent class methods for anything derived from 'object' (such as __str__, __cmp__, etc.), and, mercifully, an option for method calls that I had manually invoked previously, i.e. whatever it remembered in that object's call history.
Notably, if I start a new line and type 'file.', the appropriate methods appear in the auto-completion drop-down (close(), flush(), etc.).
I would expect that the auto-completion would also readily display read(), readlines(), close(), etc. for any object returned from an open() or popen().
Please enter that as a bug request (the problem is that PyDev can't really call your code to know what a method would return, but this specific use-case could be hard-coded - it works for file because it's a class, not a method).
Cheers,
Fabio