if the else short form
j.j.molenaar at gmail.com
Wed Sep 29 13:19:55 CEST 2010
Hi Nico, it's converting fill==True to an int, thereby choosing the
string "False," or "True," by indexing into the tuple.
Try this in an interpreter:
On 29 September 2010 12:42, Tracubik <affdfsdfdsfsd at b.com> wrote:
> Hi all,
> I'm studying PyGTK tutorial and i've found this strange form:
> button = gtk.Button(("False,", "True,")[fill==True])
> the label of button is True if fill==True, is False otherwise.
> i have googled for this form but i haven't found nothing, so can any of
> you pass me any reference/link to this particular if/then/else form?
More information about the Python-list