Something or Nothing^H^H^H^H^H^H^HEmpty

Boris Borcic borcis at geneva-link.ch
Wed Apr 10 07:53:55 EDT 2002


Anders J. Munch wrote:

> Pythons truth values are not "Something or Nothing".  The phrase seems
> to have caught on following Laura's post, but I believe it is
> misleading.
> 
> [] and {} are objects, they are objects with identity, and they are
> mutable objects.  They are empty, but they are by no means "nothing".


Yeah but test expressions provide a context of abstract interpretation,
were their coalescence as eg shadows of zero makes beautiful sense. One 
needs to note that in a "deepest" linguistic sense, zero is everywhere; 
more precisely, everywhere grammar would allow to splice in a supplement 
to the code...guess I need to expose a bit of my linguistic views to 
make myself clear.

Language - and natural language I have first in mind here - is 
structured by paradigms. A simple manner to define a paradigm, is : the 
set of variants that I could fit in place of some segment of (text, 
code), in the latter's context. Then comes a first classification of 
segments, segments that have the linguistic zero in their paradigm, and 
segments that don't. One could probably grow that division to the 
separation between grammar and lexemes, grammar relating to the segments 
equivalent to the linguistic zero, and lexical information relating to 
atomic units not by themselves repleaceable with a linguistic zero 
(=litteral nothing).

I feel the multiplicity of "false" objects, e.g. 0, [], (,), {}, None - 
and now False itself, in Python, first deserves notice as one of 
Python's most brilliant idiosyncrasies, and relates to what I just said 
above, by viewing the primary data types/structures as embedded 
mini-languages over which python code rules as a meta-language. As a 
meta-language, it's necessary that Python code can distinguish between 
the (meta-representations of) zeroes of the embedded mini-languages by 
type. At the same time, the uniform treatment of them in test 
expressions contexts, has a feeling of Big Truth to it and (I believe) I 
fully understand how Laura launched in defending the elaborate 
interpretation of that feeling that she grew while teaching Python.

I could discuss the "Something" side of the matter, but I feel the point 
you raise here very much boils down to "the type of zero is a manifest 
information that disallows viewing the typed zero as a nothing".

To sum up, I certainly agree that Python is a better and richer language 
than it would be if all other things being equal, it had a bool type and 
every test expression should first evaluate to a value of that type. But 
this is not the change that the PEP introduces, AFAIK. Fortran and 
Pascal have this, and while I understand some people feel they are 
better morals to rigidly typed booleans, to me Python's current state of 
matters is both, more interesting, simpler to use, and mysteriously 
linked to subtle "metaphysical" (meta-mathematical actually imho) 
justifications that while (a) fail having been made explicit (b) have no 
real reasons to be less compelling than "the known morals" of booleans.

Regards, Boris Borcic
--
" 12 ? The least integer symbolizing the natural numbers by itself.
  Successors : 123, 1234..."




More information about the Python-list mailing list