Skip to content

PyArg_Parse: Provide N as new format unit for non negative Py_ssize_t #138361

@wiomoc

Description

@wiomoc

Feature or enhancement

Proposal:

In gh-135763 / gh-138150 the Argument Clinic converter for Py_ssize_t was extended to optionally validate for values to be non-negative / >=0.
In principle, it would now also make sense to offer similar behavior/features for PyArg_ParseIn principle, it would now also make sense to offer similar behavior/features for PyArg_Parse*.
As n is the format unit for "signed" Py_ssize_t values, I propose N as the "unsigned" format unit for Py_ssize_t values.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

#138150 (comment)

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)pendingThe issue will be closed if no feedback is providedtopic-C-APItype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions