Steven D'Aprano wrote:
On Tue, 18 Nov 2008 15:55:10 -0500, Terry Reedy wrote:

To me, that distortion of his (and my) point is silly.  0 partipipates
in numerous integer operations, whereas None participates in no NoneType
operations.  (Neither has attributes.)  And that is the difference he is
pointing at.

Why do you care about built-in NoneType operations?

Because class-specific operations are what make one class, and instances thereof, different from another. If you don't care about that, fine, but stop ridiculing those who do. Why do you oppose people investigating specific differences?

> Why don't we count the infinite number of useful operations
> we can do to None that merely happen to not be built-in to the type?

Everything one can do with None is due to its status as a Python object.

We can convert None to a bool: bool(None)
We can append it to a list: alist.append(None)
We can convert it to a string: str(None), repr(None)
(In Python 2.6) We can ask how many bytes the None object uses.
We can ask the garbage collector how many objects refer to it: gc.get_referrers We can count how many words have been written debating whether or not None is a value.

and so forth. These operations aren't methods on NoneType but that is not of any importance. The richness or poverty of methods in a class is irrelevant.

To you, but not to me.

It is useful and convenient to have "null values" like None, but it isn't useful to say that None is not a value.

I never said that. I said that it has no attributes (other than __class__) and no private data. In other words, no content, no state. It is an empty object, just like objects()s, and similar in that to empty collections.

Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to