[Python-Dev] PEP 308: "then" "else" for deprecating "and" "or" side effects

Donn Cave donn at u.washington.edu
Fri Feb 14 12:48:32 EST 2003


On Thursday 13 February 2003 07:17 pm, Christian Tismer wrote:
|> "and" and "or" are two-headed beasts:
|> At first glance, they pretend to be logical operators.
|> At second inspection, they do this logic by promoting
|> one of their operands.

Note that there has been a current of thought about boolean logic
in Python where this would be seen as natural and transparent.

Python objects normally express a boolean value based on whether
their value is essentially ``something'' or ``nothing''.  So there's
no obvious reason to expect, when you consider a value in a boolean
context, that the result should have been compressed to some artificial
boolean data type.

	Donn Cave, donn at u.washington.edu




More information about the Python-list mailing list