Andreas Waldenburger <[email protected]> wrote:
><http://docs.python.org/release/3.1/reference/datamodel.html#the-standard-type-hierarchy>
> [ ... ]
> Boolean values behave like the values 0 and 1, respectively, in
> almost all contexts, the exception being that when converted to a
> string, the strings "False" or "True" are returned, respectively.
Hmm. So the original problem of:
button = gtk.Button(("False,", "True,")[fill==True])
could also rewritten as:
button = gtk.Button(str(bool(fill))+",")
--
\S
under construction
--
http://mail.python.org/mailman/listinfo/python-list