if the else short form

Tracubik affdfsdfdsfsd at b.com
Wed Sep 29 12:42:37 CEST 2010


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?

thanks
Nico



More information about the Python-list mailing list