[Python-Dev] For review: PEP 285: Adding a bool type (original) (raw)
Paul Prescod paul@prescod.net
Mon, 11 Mar 2002 14:06:20 -0800
- Previous message: [Python-Dev] For review: PEP 285: Adding a bool type
- Next message: [Python-Dev] For review: PEP 285: Adding a bool type
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"Gerald S. Williams" wrote:
Please don't take this as a real endorsement, and YMMV to be sure, but somehow this seems right to me given the way Python currently determines "truth": >>> 1 == True, 2 == True, [] == False (True, True, True)
I'm confident that will never be the case.
if x: ...
should be considered a shortcut syntax for
if bool(x): ...
That says nothing about the equality of the object x and one of the two truth constants.
Paul Prescod
- Previous message: [Python-Dev] For review: PEP 285: Adding a bool type
- Next message: [Python-Dev] For review: PEP 285: Adding a bool type
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]