Skip to content

Debug console returns incorrect ordering for dictionary in Python 3.7 #3236

@darrickyee

Description

@darrickyee

Environment data

  • VS Code version: 1.28.2
  • Extension version (available under the Extensions sidebar): 2018.9.2
  • OS and version: Win 7
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.0
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
  • Relevant/affected Python packages and their versions: Base

Actual behavior

dict objects display in wrong order in the debug console.

Example:
dict1

Python 3.7 preserves dictionary order using insertion order, but VSCode seems to pick some other ordering when returning a dict result to the console (perhaps sorted by key?).

Expected behavior

Display elements in debug console in the order in which they are internally stored by Python:

dict2

Steps to reproduce:

  1. Start a debug session
  2. Create a dictionary with more than one key:value pair
  3. Return the dictionary to console

Logs

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-debuggingbugIssue identified by VS Code Team member as probable bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions