Message400871
Since the ctypes module was added to the stdlib (commit babddfca758abe34ff12023f63b18d745fae7ca9 in 2006), ctypes.c_buffer() was an alias to ctypes.create_string_buffer(). The implementation contains a commented deprecation:
def c_buffer(init, size=None):
## "deprecated, use create_string_buffer instead"
## import warnings
## warnings.warn("c_buffer is deprecated, use create_string_buffer instead",
## DeprecationWarning, stacklevel=2)
return create_string_buffer(init, size)
I propose to start to deprecate ctypes.c_buffer(): use ctypes.create_string_buffer() directly.
In older ctypes version, the function was called c_string(): it's still mentioned in the ctypes documentation. This legacy is confusion, and it's time to simplify the API to provide a single function. |
|
Date |
User |
Action |
Args |
2021-09-01 21:30:22 | vstinner | set | recipients:
+ vstinner |
2021-09-01 21:30:22 | vstinner | set | messageid: <1630531822.38.0.282909766442.issue45082@roundup.psfhosted.org> |
2021-09-01 21:30:22 | vstinner | link | issue45082 messages |
2021-09-01 21:30:22 | vstinner | create | |
|