Skip to content

Conversation

@yangdanny97
Copy link
Contributor

Seems like starting in 3.12 this function returns an optional list of 4-tuples, instead of a single optional 3-tuple

https://github.com/python/cpython/blob/3.12/Lib/argparse.py#L2320

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

Diff from mypy_primer, showing the effect of this PR on open source code:

scrapy (https://github.com/scrapy/scrapy)
+ scrapy/cmdline.py:29: error: Return type "tuple[Action | None, str, str | None] | None" of "_parse_optional" incompatible with return type "list[tuple[Action | None, str, str | None, str | None]] | None" in supertype "argparse.ArgumentParser"  [override]
+ scrapy/cmdline.py:37: error: Incompatible return value type (got "list[tuple[Action | None, str, str | None, str | None]] | None", expected "tuple[Action | None, str, str | None] | None")  [return-value]

@srittau srittau merged commit 54df69d into python:main Dec 9, 2025
63 checks passed
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