On 23Jul2018 1003, Jonathan Fine wrote:
This arises out of PEP 505 - None-aware operators.
I thought, a page on how None is special would be nice.
I've not found such a page on the web. We do have
===
https://docs.python.org/3/library/constants.html
None
The sole value of the type NoneType. None is
frequently used to represent the absence of a
value, as when default arguments are not passed
to a function. Assignments to None are illegal
and raise a SyntaxError.
===
So decided to start writing such a page, perhaps to be
added to the docs. All code examples in Python3.4.
There's also
https://docs.python.org/3/c-api/none.html?highlight=py_none#c.Py_None
"The Python None object, denoting lack of value. This object has no
methods. It needs to be treated just like any other object with respect
to reference counts."
I don't know that documenting the behaviours of None are that
interesting (e.g. not displaying anything at the interactive prompt),
though it'd be perfect for a blog and/or conference talk. But if there
appear to be behaviours that are not consistent or cannot be easily
inferred from the existing documentation, then we should think about why
that is and how we could enhance the documentation to ensure it
accurately describes what None is supposed to be.
That said, your examples are good :)
Cheers,
Steve
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/