| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
ntohl(), htonl(), if_indextoname(), getaddrinfo() now use __index__() if available. Also fix the Argument Clinic names for module-level functions (although this does not affect the user).
|
As a side effect, ValueError is now raised instead of OverflowError for negative values. See also #74020. |
Sorry, something went wrong.
| class uint16_converter(CConverter): | ||
| type = "uint16_t" | ||
| converter = '_PyLong_UInt16_Converter' | ||
|
|
||
| class uint32_converter(CConverter): | ||
| type = "uint32_t" | ||
| converter = '_PyLong_UInt32_Converter' |
There was a problem hiding this comment.
Would it be possible to move uint16_t and uint32_t converters directly to Argument Clinic as built-in converters?
Sorry, something went wrong.
There was a problem hiding this comment.
I am going to do this in more general way in a separate issue. There are other converters defined in different files.
Sorry, something went wrong.
There was a problem hiding this comment.
Ok, it makes sense.
Sorry, something went wrong.
| } | ||
|
|
||
| UNSIGNED_INT_CONVERTER(UInt16, uint16_t) | ||
| UNSIGNED_INT_CONVERTER(UInt32, uint32_t) |
There was a problem hiding this comment.
You might use PyLong_AsUInt32() for this converter.
Sorry, something went wrong.
There was a problem hiding this comment.
No, PyLong_AsUInt32 cannot be used as a converter. It has wrong signature and returns wrong value.
Sorry, something went wrong.
There was a problem hiding this comment.
See #133583.
Sorry, something went wrong.
Co-authored-by: Victor Stinner <vstinner@python.org>
| Back | FazBrowse Home | New Git URL |
ntohl(), htonl(), if_indextoname(), getaddrinfo() now use index() if available.
Also fix the Argument Clinic names for module-level functions (although this does not affect the user).