Skip to content

Commit 87fc280

Browse files
cmaloneyclaude
andauthored
gh-162350: Add a signature to pickle.PickleBuffer (#162652)
Name the Argument Clinic parameter `buffer` to match the documented `PickleBuffer(buffer)` and move the type docstring into the clinic block, so `inspect.signature(pickle.PickleBuffer)` gives `(buffer, /)`. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 6a18ae4 commit 87fc280

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

‎Objects/clinic/picklebufobject.c.h‎

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Objects/picklebufobject.c‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,15 @@ PyPickleBuffer_Release(PyObject *obj)
8383
@classmethod
8484
pickle.PickleBuffer.__new__ as picklebuf_new
8585
86-
base: object
86+
buffer as base: object
8787
/
88+
89+
Wrapper for potentially out-of-band buffers.
8890
[clinic start generated code]*/
8991

9092
static PyObject *
9193
picklebuf_new_impl(PyTypeObject *type, PyObject *base)
92-
/*[clinic end generated code: output=b8269110aace6998 input=0f1cdf375a70e71d]*/
94+
/*[clinic end generated code: output=b8269110aace6998 input=616fff5fc36c22d4]*/
9395
{
9496
PyPickleBufferObject *self = (PyPickleBufferObject *) type->tp_alloc(type, 0);
9597
if (self == NULL) {
@@ -224,7 +226,7 @@ static PyMethodDef picklebuf_methods[] = {
224226
PyTypeObject PyPickleBuffer_Type = {
225227
PyVarObject_HEAD_INIT(NULL, 0)
226228
.tp_name = "pickle.PickleBuffer",
227-
.tp_doc = PyDoc_STR("Wrapper for potentially out-of-band buffers"),
229+
.tp_doc = picklebuf_new__doc__,
228230
.tp_basicsize = sizeof(PyPickleBufferObject),
229231
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
230232
.tp_new = picklebuf_new,

0 commit comments

Comments
 (0)