Skip to content

Conversation

@corona10
Copy link
Member

@corona10corona10 commented Oct 30, 2025

@corona10
Copy link
MemberAuthor

cc @StanFromIreland

@@ -0,0 +1,2 @@
Convert ``_json`` module to use Argument Clinic.
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

@corona10corona10 changed the title gh-137821: Improve Argument Clinic definitions in the _json module[WIP] gh-137821: Improve Argument Clinic definitions in the _json moduleOct 30, 2025
@corona10corona10 changed the title [WIP] gh-137821: Improve Argument Clinic definitions in the _json modulegh-137821: Improve Argument Clinic definitions in the _json moduleOct 30, 2025
deftest_overflow(self):
withself.assertRaises(OverflowError):
self.json.decoder.scanstring(b"xxx", sys.maxsize+1)
self.json.decoder.scanstring("xxx", sys.maxsize+1)
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

This was wrongly tested.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

See:

Python 3.11.6 (v3.11.6:8b6ee5ba3b, Oct 2 2023, 11:18:21) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import json >>> json.decoder.scanstring(b"xxx", 10) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: first argument must be a string, not bytes 

@corona10corona10 enabled auto-merge (squash) October 30, 2025 10:07
@corona10corona10 changed the title gh-137821: Improve Argument Clinic definitions in the _json modulegh-137821: Improve Argument Clinic definitions in the _json moduleOct 30, 2025
@corona10corona10 disabled auto-merge October 30, 2025 10:18
@corona10corona10 enabled auto-merge (squash) October 30, 2025 10:18
@corona10corona10 merged commit c45e6e1 into python:mainOct 30, 2025
46 checks passed
@corona10corona10 deleted the gh-137821-nit branch October 30, 2025 11:29
StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull request Dec 6, 2025
Sign up for freeto 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

@corona10@StanFromIreland