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
[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
> > 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
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
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
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.
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
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
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
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
10 matches
Mail list logo