Skip to content
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

add automatic conversion from string to int/float type #921

Conversation

giaco5988
Copy link
Contributor

Relates to microsoft/vscode-python#18841

Allow passing strings to the debugger for number-like inputs. With this fix strings will be accepted and automatically converted to int/float.

@int19h
Copy link
Contributor

int19h commented Apr 27, 2022

Awesome, thank you! Could you also add a test for this? We don't have a separate group of tests for JSON utilities, but a simple test that just verifies that request("foo", int) works for a string value could go into test_messaging.

src/debugpy/common/json.py Outdated Show resolved Hide resolved
src/debugpy/common/json.py Outdated Show resolved Hide resolved
@ghost
Copy link

ghost commented Apr 28, 2022

CLA assistant check
All CLA requirements met.

@giaco5988 giaco5988 requested a review from int19h April 28, 2022 12:59
@sonarcloud
Copy link

sonarcloud bot commented Apr 28, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

94.1% 94.1% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@int19h int19h left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again!

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

Successfully merging this pull request may close these issues.

2 participants