8000 gh-132983: Convert zstd __new__ methods to Argument Clinic by AA-Turner · Pull Request #133860 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-132983: Convert zstd __new__ methods to Argument Clinic #133860

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
May 12, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Convert zstd __new__ methods to Argument Clinic
  • Loading branch information
AA-Turner committed May 11, 2025
commit 2273bcee229ce898f34f2d21f55ba4afbf306a6e
27 changes: 25 additions & 2 deletions Modules/_zstd/clinic/compressor.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 25 additions & 2 deletions Modules/_zstd/clinic/decompressor.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 25 additions & 2 deletions Modules/_zstd/clinic/zstddict.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions Modules/_zstd/compressor.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,16 @@ _zstd_load_c_dict(ZstdCompressor *self, PyObject *dict)
return 0;
}

/*[clinic input]
@classmethod
_zstd.ZstdCompressor.__new__ as _zstd_ZstdCompressor_new
[clinic start generated code]*/

static PyObject *
_zstd_ZstdCompressor_new(PyTypeObject *type, PyObject *Py_UNUSED(args), PyObject *Py_UNUSED(kwargs))
_zstd_ZstdCompressor_new_impl(PyTypeObject *type)
/*[clinic end generated code: output=d1f5f14b617789e4 input=9a6b2592cd79b822]*/
{
ZstdCompressor *self;
self = PyObject_GC_New(ZstdCompressor, type);
ZstdCompressor* self = PyObject_GC_New(ZstdCompressor, type);
if (self == NULL) {
goto error;
}
Expand Down
11 changes: 8 additions & 3 deletions Modules/_zstd/decompressor.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,11 +530,16 @@ stream_decompress(ZstdDecompressor *self, Py_buffer *data, Py_ssize_t max_length
}


/*[clinic input]
@classmethod
_zstd.ZstdDecompressor.__new__ as _zstd_ZstdDecompressor_new
[clinic start generated code]*/

static PyObject *
_zstd_ZstdDecompressor_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
_zstd_ZstdDecompressor_new_impl(PyTypeObject *type)
/*[clinic end generated code: output=4987162efa80a1ea input=b7a70c8bea6b451f]*/
{
ZstdDecompressor *self;
self = PyObject_GC_New(ZstdDecompressor, type);
ZstdDecompressor* self = PyObject_GC_New(ZstdDecompressor, type);
if (self == NULL) {
goto error;
}
Expand Down
11 changes: 8 additions & 3 deletions Modules/_zstd/zstddict.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@ class _zstd.ZstdDict "ZstdDict *" "&zstd_dict_type_spec"

#define ZstdDict_CAST(op) ((ZstdDict *)op)

/*[clinic input]
@classmethod
_zstd.ZstdDict.__new__ as _zstd_ZstdDict_new
[clinic start generated code]*/

static PyObject *
_zstd_ZstdDict_new(PyTypeObject *type, PyObject *Py_UNUSED(args), PyObject *Py_UNUSED(kwargs))
_zstd_ZstdDict_new_impl(PyTypeObject *type)
/*[clinic end generated code: output=6ae0c050f7046b51 input=de39a2a410c79d2b]*/
{
ZstdDict *self;
self = PyObject_GC_New(ZstdDict, type);
ZstdDict* self = PyObject_GC_New(ZstdDict, type);
if (self == NULL) {
goto error;
}
Expand Down
0