Newb question: underscore

Gary Herron gherron at islandtraining.com
Fri Jun 6 02:17:07 CEST 2008


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 underscores 
have no special significance here, but they do make the code hard to read.

The first part of the statement directs the print to send the output to 
a file, named fd, which was presumably opened earlier ... but I don't 
think that was part of your question.

Gary Herron

> Thanks!
> --
> http://mail.python.org/mailman/listinfo/python-list
>   




More information about the Python-list mailing list