[Tutor] _ function

Paul W. Frields stickster at gmail.com
Wed Jul 11 21:47:20 CEST 2007


> > On Wed, Jul 11, 2007 at 11:03:18AM -0400, John Morris wrote:
> > > I'm editing some code from Mailman and seeing:
> > > 
> > > legend = _("%(hostname)s Mailing Lists")
> > > 
> > 
> > The outter parenthese are a function call.  The underscore
> > is a name that has a callable as a value, I suppose.  I
> > believe that the value of the name underscore is the last
> > expression evaluated, but I'm not sure.

FWIW, I think that by convention _ is an alias for a translation
function.  In other words, this message is marked as one that is
translatable.  I'm only guessing, but I've run into this in some UI code
in Python I've seen.

By the way, I would like to say that I am somewhat of a newbie to
Python, and also that I really appreciate the knowledge I've picked up
on this list thus far.  To all those of you who take time out of your
busy day to answer questions, thank you!

-- 
Paul W. Frields, RHCE                          http://paul.frields.org/
  gpg fingerprint: 3DA6 A0AC 6D58 FEC4 0233  5906 ACDB C937 BD11 3717
      Fedora Project:  http://fedoraproject.org/wiki/PaulWFrields
  irc.freenode.net: stickster @ #fedora-docs, #fedora-devel, #fredlug
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://mail.python.org/pipermail/tutor/attachments/20070711/b8e7650c/attachment-0001.pgp 


More information about the Tutor mailing list