mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
bpo-29852: Argument Clinic Py_ssize_t converter now supports None (#716)
if pass `accept={int, NoneType}`.
This commit is contained in:
parent
ea720fe7e9
commit
762bf40438
20 changed files with 98 additions and 200 deletions
|
|
@ -18,13 +18,6 @@ class _io.TextIOWrapper "textio *" "&TextIOWrapper_TYpe"
|
|||
[clinic start generated code]*/
|
||||
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=2097a4fc85670c26]*/
|
||||
|
||||
/*[python input]
|
||||
class io_ssize_t_converter(CConverter):
|
||||
type = 'Py_ssize_t'
|
||||
converter = '_PyIO_ConvertSsize_t'
|
||||
[python start generated code]*/
|
||||
/*[python end generated code: output=da39a3ee5e6b4b0d input=d0a811d3cbfd1b33]*/
|
||||
|
||||
_Py_IDENTIFIER(close);
|
||||
_Py_IDENTIFIER(_dealloc_warn);
|
||||
_Py_IDENTIFIER(decode);
|
||||
|
|
@ -1529,13 +1522,13 @@ textiowrapper_read_chunk(textio *self, Py_ssize_t size_hint)
|
|||
|
||||
/*[clinic input]
|
||||
_io.TextIOWrapper.read
|
||||
size as n: io_ssize_t = -1
|
||||
size as n: Py_ssize_t(accept={int, NoneType}) = -1
|
||||
/
|
||||
[clinic start generated code]*/
|
||||
|
||||
static PyObject *
|
||||
_io_TextIOWrapper_read_impl(textio *self, Py_ssize_t n)
|
||||
/*[clinic end generated code: output=7e651ce6cc6a25a6 input=8c09398424085cca]*/
|
||||
/*[clinic end generated code: output=7e651ce6cc6a25a6 input=123eecbfe214aeb8]*/
|
||||
{
|
||||
PyObject *result = NULL, *chunks = NULL;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue