-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Error when choosing rename option after editing tuple value from Variable explorer. #5885
Comments
Thanks for reporting. I've reproduced the apparent bug, minimized even further:
However, renaming etc works fine on any of those objects when done on the parent object, from the main variable explorer window, which I assume is what you are intending to do, so at least until this is fixed you can simply do that with no loss in actual functionality. Therefore, it seems that either "Rename" and "Duplicate" should be disabled in the contextmenu when within variable explorer sub windows, as those commands do not (and, likely cannot) function properly on the sub elements (i.e. indicies) of most parent objects, or within that window they should still act on the parent object (more functional, but perhaps more confusing/inconsistent). @ccordoba12 would be able to respond more authoritatively to this. |
@ccordoba12 renaming within a collection editor offers the user the possibility to break the data model: for example within the editor of
|
@Prikers Out of curiosity, what would be the practical use of doing so, given the limitations you mention? Also, probably restating the obvious, but the latter choice (disabling the rename and duplicate options) would presumably be what should happen for tuples regardless. Also, on a tangentially related note, mucking around with a tuple in the Variable Explorer actually lets me edit (rather than just select, copy etc) its values when the text box is active, but the changes don't stick (of course). Presumably, the text should be selectable, but not editable, to match the immutability of the data type—I would imagine this would just be some property of the textbox Qt object that needs to be set, or something like that? |
I think that's the simplest option, yep. |
Right, I agree with this one too. |
I agree with that! Should it be a different issue/PR though?
I cannot see any but I wanted to make sure I was not missing something 😄 |
Description
What steps will reproduce the problem?
tup = 123,'abc', 235, (2,3,5)
tup = tup + ('a', 'b')
2.
From Variable explorer - Edit the tup variable.
3.
Choose Rename and it will thru an error
What is the expected output? What do you see instead?
Please provide any additional information below
File "C:\Users\S381753\Python\Anaconda3\lib\site-packages\spyder\widgets\variableexplorer\collectionseditor.py", line 972, in rename_item
self.copy_item(True)
File "C:\Users\S381753\Python\Anaconda3\lib\site-packages\spyder\widgets\variableexplorer\collectionseditor.py", line 955, in copy_item
QLineEdit.Normal, orig_key)
TypeError: getText(QWidget, str, str, echo: QLineEdit.EchoMode = QLineEdit.Normal, text: str = '', flags: Union[Qt.WindowFlags, Qt.WindowType] = Qt.WindowFlags(), inputMethodHints: Union[Qt.InputMethodHints, Qt.InputMethodHint] = Qt.ImhNone): argument 5 has unexpected type 'int'
Version and main components
Dependencies
The text was updated successfully, but these errors were encountered: