what does 'for _ in range()' mean?

Roy Smith roy at panix.com
Fri Jul 30 20:09:40 CEST 2004


In article <mailman.975.1091208384.5135.python-list at python.org>,
 Skip Montanaro <skip at pobox.com> wrote:

>     Dave> Speaking of which, am I the only one here that sees this _()
>     Dave> function as a total hack?
> 
> It's a convention adopted by the i18n folks which got imported to Python.
> Preexisting tools that wander through the source and build dictionaries of
> string literals will work with C, Python or Perl (or whatever).  The string
> 
>     "My dog has fleas"
> 
> becomes
> 
>     _("My dog has fleas")

It should become "My dog has no nose".

I wonder how those tools deal with all the interesting sorts of ways 
Python has for quoting strings?



More information about the Python-list mailing list