New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add autocompletion for keys in dictionaries #54560
Comments
should be extended by this one: |
Thank you for the report and patch. This is a new feature, thus targetting the py3k branch (future 3.2). If your patch is not against this branch, can you refresh it? Also, please attach it as text file(s), and generally follow guidelines outlined at http://www.python.org/dev/patches/ Thanks again! |
Hi Éric, thanks for guiding. So, attached is the concatenation of two forward unified diffs for rlcompleter.py and test_rlcompleter.py -- both as of py3k trunk. Tested against Python 3.1.2 though. P.S. hm, py3k code appeared to be surprisingly nicer -- no unicode troubles and work-arounds at all... regards |
Guys, do you expect anythig else from me in respect to this issue? Let me know it before my non-stopable garbage collector wipes all the details from my brain away :) |
I will review your patch later today. |
Review time! + elif "[" in text: I’m not familiar with rlcompleter’s internals, so I’d like a few comments sprinkled in the code. Please wrap your lines at 79 columns, and follow other advice given at http://www.python.org/dev/patches/ for the next version of your patch. + The evaluation of the part before the '[' could be enhanced. + 'DictCompleteMe[\'öh, вау!\']', |
Some thoughts and observations from trying this patch out:
It works for custom dictionaries, so it can invoke custom code to list the keys. Maybe this is okay; I wouldn’t expect listing an object’s keys to have a serious effect. But you could add a Mapping (and Sequence) ABC check in case the object implements keys() but is not really a dictionary. It would be nice for this to work by default, because Tab completion is now enabled by default. But I worry if changing the default completer delimiters globally will be a compatibility problem. There is a mega ugly regular expression in the patch. Is there another way to do whatever it is doing? Failing that, you could add comments, group names, etc to make it more understandable. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: