[Python-ideas] Python docs: page: In what ways in None special
Rhodri James
rhodri at kynesim.co.uk
Wed Aug 15 08:40:56 EDT 2018
On 15/08/18 00:09, Chris Barker wrote:
> On Tue, Aug 14, 2018 at 10:45 AM, Rhodri James<rhodri at kynesim.co.uk> wrote:
>
>> On 'None is a constant':
>>
>> Erm. I think you've got carried away with simplifying this and gone down
>> a blind alley. None is a literal, and like any other literal can't be
>> rebound.
>
> no, it's not -- None is keyword, and just like any other keyword, it can't
> be re-bound. However, every other keyword I tried to rebind results in a
> generic:
It's both, really. In many ways it's only a keyword because Python
doesn't otherwise have a way of creating non-rebindable names. It's
purpose is to represent the singular object of NoneType, and in that
sense it's a literal as much as [] or "".
--
Rhodri James *-* Kynesim Ltd
More information about the Python-ideas
mailing list