Skip to content

Debugger console prints the key when the key doesn't exist in a dict #661

@segevfiner

Description

@segevfiner

Environment data

VS Code version: 1.19.3
Python Extension version: 0.9.1
Python Version: 2.7.12
OS and version: Ubuntu 16.04.3 x64

Actual behavior

The debugger console gives a weird result when indexing a dict with a key that doesn't exist in the dict. It prints the key... which is confusing and unexpected.

Expected behavior

It prints that the key doesn't exist. (KeyError)

Steps to reproduce:

  • Debug a file that has a dict, for example:
a = {'a': 123}
  • Type in the debugger console:
>>> a['a']
123
>>> a['b']
'b' # ???

GIF

vscode-bug

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions