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: >>> ['a','b'][False] 'a' >>> ['a','b'][True] 'b' >>> int(False) 0 >>> int(True) 1 Joost On 29 September 2010 12:42, Tracubik <affdfsdfds...@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? > > thanks > Nico > -- > http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list