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

gh-105712: Use appropriate regex to detect negative numbers in arguments #114833

Closed
wants to merge 1 commit into from

Conversation

marcusmueller
Copy link

@marcusmueller marcusmueller commented Feb 1, 2024

Fix the issue that::

parser.add_argument("-p", "--param", type=float)
args = parser.parse_args()

fails to correctly deal with -p -3e12, thinking that -3e12 is an option,
not a parameter to one. That's because the old regex was too restrictive.
This fixes that with no found downsides.

Copy link

cpython-cla-bot bot commented Feb 1, 2024

All commit authors signed the Contributor License Agreement.
CLA signed

…arguments

previously, type=float values like -3e12 would be misinterpreted as -option

Signed-off-by: Marcus Müller <[email protected]>
@marcusmueller marcusmueller marked this pull request as draft February 1, 2024 01:26
@marcusmueller marcusmueller deleted the fix-ussue-105712 branch February 12, 2024 10:46
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.

1 participant