-
-
Notifications
You must be signed in to change notification settings - Fork 245
Tab completion for dict key causes crash #917
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
Comments
Thanks for reporting! @arian-deimling you mentioned wanting to work on something earlier, do you want to give this a shot? |
Sure |
Hey, I found the issue, it's this line right here Line 37 in b66a29f
r"""[\w_][\w0-9._]*\[([\w0-9._(), '"]*)""" ______________________^^^^^^^^^^^^^^^^ this is the cause of the bug
It's using that regex to capture the current key of the dictionary for which it is showing text completion of keys in the interactive terminal, and the key portion of the dictionary in that regex is too restrictive. The text completion works better with the following regex: Does this seem like a good adjustment to make? Also, with this change there is still an issue; now, if you do the following in a bython interactive session, you cannot tab-complete the key for
I'll keep working on this to find out why the tab completion isn't working (I'm guessing it's another regex issue). |
That seems like the right place to be adjusting to me. |
@thomasballinger Got the bug fixed and submitted pull request #920. Please let me know if there is an issue with the pull request; this is my first time contributing to an open source project! |
This issue is not reproducible with several different
dict
s that I've tried, but it can be reproduced with thedict
below.Steps to recreate:
dict
my_dict[
Image below so you can see the colors as well:

The text was updated successfully, but these errors were encountered: