[Tutor] simplifications : are they good ?

Jean Montambeault jrm@videotron.ca
Thu, 6 Dec 2001 22:40:16 +0200


----- Original Message -----
From: "Danny Yoo" <dyoo@hkn.eecs.berkeley.edu>

In the same vein, the author of:

> Label(fen1, text = 'Premier champ :').grid(sticky =E)
> Label(fen1, text = 'Second :').grid(sticky =E)
> Label(fen1, text = 'Troisième :').grid(sticky =E)

probably felt that giving a name to each Label was unnecessarily
convoluted, when the author wasn't planning to do anything more with the
Label.  This is often the case of Labels, because the user doesn't really
interact with labels after they're placed in a GUI.

The author could have written:

##
l1 = Label(fen1, text='Premier champ :')
l2 = Label(fen1, text='Second :')
l3 = Label(fen1, text = 'Troisième :')
l1.grid(sticky = E)
l2.grid(sticky = E)
l3.grid(sticky = E)
###

but as far as Python is concerned, there's negligible difference in the
efficiency of this process.


Hope this helps!

Yes it does. That's exactly what I wanted : reading your take on that.
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor