This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients benjamin.peterson, larry, serhiy.storchaka, stutzbach
Date 2017-03-19.11:28:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1489922927.22.0.81107726334.issue29852@psf.upfronthosting.co.za>
In-reply-to
Content
Many methods in the io module accept int and None and convert the argument to Py_ssize_t. Proposed patch adds common Argument Clinic converter for that case. The Py_ssize_t converter now takes the accept argument that can be {int} (the default) or {int, NoneType}. In the latter case None is acceptable value which means using the default value.

Similar converter was previously used locally in the io module, now it is used also in the mmap module.

Examples:

_io.BytesIO.read
    size: Py_ssize_t(accept={int, NoneType}) = -1
    /

_io.BytesIO.truncate
    size: Py_ssize_t(accept={int, NoneType}, c_default="self->pos") = None
    /
History
Date User Action Args
2017-03-19 11:28:47serhiy.storchakasetrecipients: + serhiy.storchaka, larry, benjamin.peterson, stutzbach
2017-03-19 11:28:47serhiy.storchakasetmessageid: <1489922927.22.0.81107726334.issue29852@psf.upfronthosting.co.za>
2017-03-19 11:28:47serhiy.storchakalinkissue29852 messages
2017-03-19 11:28:46serhiy.storchakacreate