ACCEPTED: PEP 285
Paul Rubin
phr-n2002a at nightsong.com
Thu Apr 4 09:34:33 EST 2002
Guido van Rossum <guido at python.org> writes:
> > I think there will need to be a format code for truth values:
> >
> > ("%b" % True) => "True"
>
> There's no need. "%s" % True already yields 'True'. if you want
> coercion to bool, use "%s" % bool(b).
In that case there's also no need for %d, since "%s" % 17 already
yields '17'. If ints have a format code and bools don't, one is
left with the impression that bools aren't as respectable a type
as ints. That doesn't seem in the spirit of the PEP.
More information about the Python-list
mailing list