Does Python need an 'xor' operator?

Neil Hodgson nhodgson at bigpond.net.au
Sun Apr 14 18:59:44 EDT 2002


phil hunt:

> How will it break code to introduce a new operator? Any existing
> program that uses xor will be a syntax error, and broken already.

   Current code:

xor = 1

   will break. Operators are keywords, so

or = 1

   produces:

Traceback (  File "<interactive input>", line 1
    or = 1
     ^
SyntaxError: invalid syntax

   Neil






More information about the Python-list mailing list