8000 GH-123945: Update regex for parsing negative numbers that contain underscores by savannahostrowski · Pull Request #123970 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-123945: Update regex for parsing negative numbers that contain underscores #123970

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

Merged
merged 14 commits into from
Sep 17, 2024
Merged
Prev Previous commit
Next Next commit
appease linter
  • Loading branch information
savannahostrowski committed Sep 15, 2024
commit 77888a734c0816719db74210b42cdb11eed04e84
4 changes: 2 additions & 2 deletions Lib/test/test_argparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -5715,12 +5715,12 @@ def test_double_dash(self):
self.assertEqual(NS(foo=[], bar=[]), args)
args = parser.parse_args(['--foo', 'a', 'b', '--', 'c', 'd'])
self.assertEqual(NS(foo=['a', 'b'], bar=['c', 'd']), args)

def test_negative_number_success(self):
parser = argparse.ArgumentParser()
parser.add_argument('--int', type=int)
parser.add_argument('--float', type=float)

args = parser.parse_args(['--int', '-1000', '--float', '-1000.0'])
self.assertEqual(NS(int=-1000, float=-1000.0), args)

Expand Down
Loading
0