Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Dict keys order is altered in debug sessions even with Python 3.7+ #2051

Closed
beeb opened this issue Jan 22, 2020 · 3 comments
Closed

Dict keys order is altered in debug sessions even with Python 3.7+ #2051

beeb opened this issue Jan 22, 2020 · 3 comments

Comments

@beeb
Copy link

beeb commented Jan 22, 2020

It seems to be the same as microsoft/vscode-python#3236

Environment data

  • VS Code version: 1.41.1
  • Extension version (available under the Extensions sidebar): 2020.1.58038
  • OS and version: Windows 10 + macOS Catalina
  • Python version (& distribution if applicable, e.g. Anaconda): Anaconda 3.7.6
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): miniconda
  • Relevant/affected Python packages and their versions: N/A
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info How to update the language server to the latest stable version vscode-python#3977): jedi

Expected behaviour

In a debug session with Python 3.7+, insertion order of the keys in a dictionary are respected

Actual behaviour

In a debug session with Python 3.7+, the keys of a dictionary get re-ordered (what seems like alphabetically).
It's important to note that executing the same code in an external terminal with the same conda environment, or even in an interactive python session in the internal terminal, leads to the expected behavior. This issue is specific to the debug console!

Steps to reproduce:

  1. Add a breakpoint in some python 3 source
  2. Start a debugging session using a python 3.7+ environment
  3. When the script pauses at the breakpoint, open the debug console
  4. Initialize and populate a python dict, making sure the keys are not in alphabetical order
  5. Type the name of the dict to display its value
  6. Observe that the keys order is not anymore the insertion order, rather they are sorted alphabetically

Capture

Logs

Irrelevant I think?

@karthiknadig karthiknadig transferred this issue from microsoft/vscode-python Jan 22, 2020
@karthiknadig
Copy link
Member

This is a dupe of #998

@beeb
Copy link
Author

beeb commented Jan 23, 2020

Wow, since the 9 november 2018? Any idea why this is taking so long?

@karthiknadig
Copy link
Member

@beeb it wasn't prioritized. Please up-vote the issue, since we take that into account while prioritizing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants