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 <rep...@bugs.python.org> <http://bugs.python.org/issue17238> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com