This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2013年02月19日 15:32 by Ramchandra Apte, last changed 2022年04月11日 14:57 by admin.
| Messages (8) | |||
|---|---|---|---|
| msg182392 - (view) | Author: Ramchandra Apte (Ramchandra Apte) * | Date: 2013年02月19日 15:32 | |
[patch under development] I propose to add completions for import <tab> from <tab> from x import <tab> Also, if one types imp.<tab> , IDLE should import the module and list dir(module). (There will be an option to disable/enable the last two completion cases as some users object to it importing modules for completion) |
|||
| msg191227 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2013年06月15日 19:22 | |
Making a list of all possible modules is harder than a list of attributes. With relative imports, I am not sure its even possible to sensible make a list of every entry that would work. |
|||
| msg191260 - (view) | Author: Ramchandra Apte (Ramchandra Apte) * | Date: 2013年06月16日 05:06 | |
I have a patch ready; have to make it ready (PEP8-compliance etc.) and then I can send it. On 16 June 2013 00:52, Terry J. Reedy <report@bugs.python.org> wrote: > > Terry J. Reedy added the comment: > > Making a list of all possible modules is harder than a list of attributes. > With relative imports, I am not sure its even possible to sensible make a > list of every entry that would work. > > ---------- > > _______________________________________ > Python tracker <report@bugs.python.org> > <http://bugs.python.org/issue17238> > _______________________________________ > |
|||
| msg271199 - (view) | Author: Martin Panter (martin.panter) * (Python committer) | Date: 2016年07月25日 01:23 | |
Even if your patch isn’t quite ready, it may (have been) better than nothing :) I had the idea to share stuff between Idle completion and Readline completion, but after looking at the Idle code, it did not seem very practical in general. But maybe you can at least use some ideas, test cases, or share the low level code from Issue 25419. E.g. my patch there has method _import_matches() that takes a path of packages and yields (sub)module names, and method _from_import_matches() that also yields module attribute names. |
|||
| msg271216 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2016年07月25日 02:51 | |
I change 'enhance' to 'add' because there is no 'import completion' now. Ramchandra, when replying by email, delete the quoted email. But do submit a patch even is less than perfect. The idea of autoimporting a name to complete an attribute is separate from the idea of doing something special in import statements. Autoimport is the subject of #18766, which has a patch and my thoughts so far. So this issue is only about import statements. Martin, I just opened #27609 as an umbrella issue for multiple completion issues. I am not happy with the current IDLE completion code. Does any of the readline completion code depend on function provided by readline, or is it all an extension of readline, using logic in Python? |
|||
| msg271348 - (view) | Author: Martin Panter (martin.panter) * (Python committer) | Date: 2016年07月26日 08:53 | |
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. |
|||
| msg370848 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2020年06月06日 19:31 | |
I opened #40892 for using rlcomplete suffixes. I should look as #25419 for patch and messages for import ideas. |
|||
| msg373246 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2020年07月07日 20:31 | |
+1 for import completion. Above, I misspelled 'rlcompleter' as 'rlcomplete'. When I just tried to import it as part of responding to #41230, the wrong name did not work. I wish I could have stopped with 'import rl'<tab>. To add a note to #37765, I tried 'import keywords'. Nope, no 's'. 'import ke'<tab> would have been nice. I suspect that some beginners have as much trouble with names they have no recently used. im<tab> would work if keywords were added to the tab completion list. #37765. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:42 | admin | set | github: 61440 |
| 2020年07月07日 20:31:48 | terry.reedy | set | messages: + msg373246 |
| 2020年06月07日 21:59:21 | terry.reedy | set | versions: + Python 3.10, - Python 3.6 |
| 2020年06月06日 19:31:51 | terry.reedy | set | messages: + msg370848 |
| 2016年07月26日 08:53:30 | martin.panter | set | messages: + msg271348 |
| 2016年07月25日 02:51:20 | terry.reedy | set | title: IDLE: Enhance import statement completion -> IDLE: Add import statement completion messages: + msg271216 versions: + Python 3.6, - Python 3.4 |
| 2016年07月25日 01:23:33 | martin.panter | set | nosy:
+ martin.panter messages: + msg271199 |
| 2016年07月25日 00:08:07 | terry.reedy | link | issue27609 dependencies |
| 2013年06月17日 20:35:11 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka |
| 2013年06月16日 05:06:35 | Ramchandra Apte | set | messages: + msg191260 |
| 2013年06月15日 19:22:40 | terry.reedy | set | messages: + msg191227 |
| 2013年04月07日 01:36:20 | roger.serwy | set | nosy:
+ roger.serwy title: Enhance import statement completion -> IDLE: Enhance import statement completion |
| 2013年02月19日 15:35:51 | ezio.melotti | set | stage: needs patch versions: - Python 3.3 |
| 2013年02月19日 15:32:51 | Ramchandra Apte | create | |