[Python-Dev] Re: PEP 285: Adding a bool type

Mark McEahern marklists at mceahern.com
Wed Apr 3 13:14:27 EST 2002


[Ka-Ping Yee]
> Consider this:
>
>     >>> a = [0, False, 1, True]
>
>     >>> print a
>     [0, 0, 1, 1]
>
>     >>> for x in a: print x
>     0
>     0
>     1
>     1

Actually, if you use the sample code provided by the PEP and run this you
get:

  >>> a = [0, False, 1, True]
  >>> print a
  [0, False, 1, True]

  >>> for x in a: print x
  0
  False
  1
  True






More information about the Python-list mailing list