Does Python need an 'xor' operator?

Ken Peek Ken.Peek at SpiritSongDesigns.comNOSPAM
Sun Apr 14 23:25:20 EDT 2002


"logistix" <logstx at bellatlantic.net> wrote in message
news:vTou8.20361$8W5.17808 at nwrddc02.gnilink.net...

| < snip! >
|
| So then the next question is, Are non-existant
| values considered False or should they throw an
| error?
|
| < snip! >

That is an EASY one (for even ME) to answer:

An undefined variable is a programming disaster waiting to
happen, and so should ALWAYS throw an exception if you try
to access it before it is defined.  If the variable has been
defined, but does not yet have a value, it should ALWAYS
return 'None' as a value, which has the meaning of 'False'
when used in a conditional statement.






More information about the Python-list mailing list