[issue17238] IDLE: Add import statement completion

Martin Panter report at bugs.python.org
Tue Jul 26 04:53:31 EDT 2016


Martin Panter added the comment:

The readline completion code does not strictly depend on on Readline, although currently it is modelled after its quirky API. But we can change that by adding a more general API.

In <https://bugs.python.org/issue25419#msg266320>, I suggested an API “complete_code(code) -> list of modules, attributes, globals, etc.” In the Readline case, you pass in the line of code up to the cursor, and it would return possible completions. Perhaps Idle might pass in multiple lines of code. There could also be a predefined global namespace, either as another parameter, or preloaded into a completer object.

When I briefly looked at the Idle code a while back, it did not seem easy for me to adapt to this sort of API. But maybe you have a better idea of what could be done.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17238>
_______________________________________


More information about the Python-bugs-list mailing list