Re: Newb question: underscore

2008-06-06 Thread Bruno Desthuilliers
John Fabiani a écrit : Skye wrote: What is this doing? print >> fd, _(__doc__) I'm guessing line-splitting __doc__ into a list, but what's that leading underscore do? Thanks! I think it is standard practice to use the underscore for unicode converts. Actually, it's for i18n, not for

Re: Newb question: underscore

2008-06-06 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : My question is: Why would anyone decide to obfuscate something as easy to read as Python??? They didn't decide to obfuscate; they decided to follow a strongly-expected convention for the name of that function by existing users of the 'gettext' functionality, in contex

Re: Newb question: underscore

2008-06-05 Thread cokofreedom
> > My question is: Why would anyone decide to obfuscate something as easy > > to read as Python??? > > They didn't decide to obfuscate; they decided to follow a > strongly-expected convention for the name of that function by existing > users of the 'gettext' functionality, in contexts that predate

Re: Newb question: underscore

2008-06-05 Thread Ben Finney
bvdp <[EMAIL PROTECTED]> writes: > My question is: Why would anyone decide to obfuscate something as easy > to read as Python??? They didn't decide to obfuscate; they decided to follow a strongly-expected convention for the name of that function by existing users of the 'gettext' functionality, i

Re: Newb question: underscore

2008-06-05 Thread John Fabiani
Skye wrote: > What is this doing? > > print >> fd, _(__doc__) > > > I'm guessing line-splitting __doc__ into a list, but what's that > leading underscore do? > > Thanks! I think it is standard practice to use the underscore for unicode converts. -- http://mail.python.org/mailman/listinfo/p

Re: Newb question: underscore

2008-06-05 Thread bvdp
My guess would be someone has used the common convention of naming the "get the corresponding localised version of this string from the application's gettext database" function as '_' for convenience. Funny that this comes up. I just noticed this in some code I was looking at the other day.

Re: Newb question: underscore

2008-06-05 Thread Skye
Ohh, it's a function _() call. Now it makes sense. Of course Python would be consistent... I was expecting trickery! It's actually from the Mailman source, def _(s) is a string function for i18n Thanks, Skye -- http://mail.python.org/mailman/listinfo/python-list

Re: Newb question: underscore

2008-06-05 Thread Ben Finney
Skye <[EMAIL PROTECTED]> writes: > What is this doing? > > print >> fd, _(__doc__) Without any context, it's impossible to know. > I'm guessing line-splitting __doc__ into a list, but what's that > leading underscore do? Look at the rest of the module to see where that name comes from; per

Re: Newb question: underscore

2008-06-05 Thread Gary Herron
Skye wrote: What is this doing? print >> fd, _(__doc__) I'm guessing line-splitting __doc__ into a list, but what's that leading underscore do? It's calling a function with a single argument, like sqrt(x), except the function is named _ and the argument is named __doc__. The unders

Newb question: underscore

2008-06-05 Thread Skye
What is this doing? print >> fd, _(__doc__) I'm guessing line-splitting __doc__ into a list, but what's that leading underscore do? Thanks! -- http://mail.python.org/mailman/listinfo/python-list