New GitHub issue #110863 from pitrou:<br>

<hr>

<pre>
# Feature or enhancement

### Proposal:

The following C API functions would be nice to have and probably easy to provide.
```c
PyAPI_FUNC(PyObject *) PyLong_FromIntptr_t(Py_intptr_t);
PyAPI_FUNC(PyObject *) PyLong_FromUintptr_t(Py_uintptr_t);

PyAPI_FUNC(Py_intptr_t) PyLong_AsInptr_t(PyObject *);
PyAPI_FUNC(Py_uintptr_t) PyLong_AsUinptr_t(PyObject *);
```

Note that the given integers types should exist, as they have official counterparts [in C99](https://en.cppreference.com/w/c/types/integer).

### Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

### Links to previous discussion of this feature:

There is a discussion of a similar feature in https://github.com/python/cpython/issues/62070, but I would argue that `intptr_t` and `uintptr_t` are much more common in real life that `intmax_t`.
</pre>

<hr>

<a href="https://github.com/python/cpython/issues/110863">View on GitHub</a>
<p>Labels: type-feature, topic-C-API</p>
<p>Assignee: </p>