[Python-Dev] Challenge about print >> None

Fredrik Lundh Fredrik Lundh" <effbot@telia.com
Tue, 12 Sep 2000 21:34:58 +0200


vladimir wrote:
> In the case of extended print, half of us perceive that as a mix of
> concepts unrelated to Python, the other half sees them as natural
> for specifying default behavior in Python.

Sigh.  None doesn't mean "default", it means "doesn't exist"
"nothing" "ingenting" "nada" "none" etc.

"def foo(): return" uses None to indicate that there was no
return value.

"map(None, seq)" uses None to indicate that there are really
no function to map things through.

"import" stores None in sys.modules to indicate that certain
package components doesn't exist.

"print >>None, value" uses None to indicate that there is
really no redirection -- in other words, the value is printed
in the usual location.

</None>