[Python-ideas] Optional parameters without default value

Ivan Levkivskyi levkivskyi at gmail.com
Thu Mar 2 03:45:09 EST 2017


On 2 March 2017 at 09:36, M.-A. Lemburg <mal at egenix.com> wrote:

> On 02.03.2017 09:03, Serhiy Storchaka wrote:
> > Function implemented in Python can have optional parameters with default
> [...]
>
Why a new syntax ? Can't we just have a pre-defined sentinel
> singleton NoDefault and use that throughout the code (and also
> special case it in argument parsing/handling)?
>

I think for the sane reason that we didn't add Undefined to PEP 484 and PEP
526:
Having "another kind of None" will cause code everywhere to expect it.
(Plus Guido didn't like it)

--
Ivan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20170302/404d8379/attachment.html>


More information about the Python-ideas mailing list