Menu

auto-completion not working - files and pipes

2011-05-13
2013-03-15
  • Gabriel M. Elder

    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().

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2011-05-15

    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

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.