Mercurial/Python - What Does The Underscore Function Do? -


In Mercurial, many extensions wrap their help / syntax string in the call of an underscore function such as:

  _ ('[OPTION] [QUEUE]')  

This confuses me, because it does not seem necessary (instructions are not mentioned) and do not seem to be That's a _ defined in the class, so I'm thinking that this is a special syntax that I do not understand, maybe Lambda Another way, or perhaps identifying function Hane? In addition, I am thinking that the benefit of this method (whatever is happening) is just like the raw string, as if the documentation suggests.

In the Python document I have not mentioned anything such a function, so I 'm not sure whether it is actually a Python question, or an absurd question.

Here are two examples that use this framework (see cmdtable dictionary below)

  • Look at line 45:

    to

      This is a common abbreviation in the internationalization package, and possibly other packages, for the function which translates the logic of the language in which the program is running. This feature is short for  _ , because it is used for every message displayed to the user. 

    It appears that Mercury is wrapped in its module. ("I-18N" means "internationalization" as there is 18 letters between "I" and "N").


    Comments