ACCEPTED: PEP 285
David Bolen
db3l at fitlinxx.com
Thu Apr 4 20:44:23 EST 2002
James Logajan <JamesL at Lugoj.com> writes:
> Then I'd like to complain that neither you nor Guid va Rossu addressed the
> question I asked in my previous message concerning bools as keys. If a bool
> is to be treated as an int sometimes and sometimes not, I don't recall
> seeing anything about whether it will be treated as an int as a dictionary
> key. If I do:
Guido did cover this explicitly in one of his responses to the bool
threads - see:
http://groups.google.com/groups?selm=mailman.1017860357.6448.python-list%40python.org
which includes among other comments:
"False and True are numbers, and they are equal (==) to 0 and 1;
everything else follows from there."
and
"No you're not. d[0] and d[False] retrieve the same value, as do
d[0L], d[0.0], and d[0j]."
--
-- David
--
/-----------------------------------------------------------------------\
\ David Bolen \ E-mail: db3l at fitlinxx.com /
| FitLinxx, Inc. \ Phone: (203) 708-5192 |
/ 860 Canal Street, Stamford, CT 06902 \ Fax: (203) 316-5150 \
\-----------------------------------------------------------------------/
More information about the Python-list
mailing list