forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
Environment data
- VS Code version: 1.29.1
- Extension version (available under the Extensions sidebar): 2018.10.1
- OS and version: Windows 10 1803
- Python version (& distribution if applicable, e.g. Anaconda): 3.7
- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
- Relevant/affected Python packages and their versions: N/A
Actual behavior
When debugging a Python script, OrderedDicts displays their content in a seemingly random order.
Expected behavior
OrderedDicts should display their content according to the insertion order.
Steps to reproduce:
- Save the following code in a file
from collections import OrderedDict
if __name__ == "__main__":
my_ordered_dict = OrderedDict()
my_ordered_dict['trois'] = 3
my_ordered_dict['deux'] = 2
my_ordered_dict['un'] = 1
my_ordered_dict['zero'] = 0
print(my_ordered_dict)
- Set a breakpoint on the print function (last line)
- Look at either the Debug panel or the Object representation on the Debug Console. Curiously, directly calling the str or repr shows the expected behavior.
Note
This is very similar to #3236 , but it uses OrderedDict instead of the regular dict and it also happens on the debug panel ( #3236 only mentions the console, I don't know how close those two elements are linked). I hope this issue is not too redundant.
Metadata
Metadata
Assignees
Labels
No labels
