Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Support __index__() for unsigned integer converters in PyArg_Parse and Argument Clinic #132987

Closed
Assignees
serhiy-storchaka
@serhiy-storchaka

Description

@serhiy-storchaka

The__index__() special method was introduced to make other integer-like types which are notint subclasses to be accepted as integer arguments.

It is supported by allPyArg_Parse format units for integers, exceptk (long sized bitfield) andK (long long sized bitfield). Argument Clinic has the same behavior forunsigned_long(bitwise=True) andunsigned_long_long(bitwise=True). It supports also non-bitwise unsigned integer converters, all of them do not support__index__().

Note that makingPyLong_AsUnsignedLong() andPyLong_AsUnsignedLongLong() to support__index__() is potentially unsafe. But the higher level code that uses them, can be changed.

Linked PRs

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp