In Mercurial, many of the extensions wrap their help/syntax string in a call to an underscore function, like so:
_('[OPTION] [QUEUE]')
This confuses me, because it does not seem necessary (the Writing Extensions instructions don't mention it) and there doesn't seem to be a _ defined in the class, so I'm wondering if this is some special syntax that I don't understand, perhaps another way to say lambda, or maybe the identity function? Additionally I'm wondering what the benefit of this methodology (whatever it is) is over just the raw string like the documentation suggests.
Nothing I've seen in the Python documentation mentions such a function, so I'm not sure if this is really a Python question, or a Mercurial question.
Here are two examples that use this structure (look at the cmdtable
dictionary near the bottom of the file)
http://selenic.com/repo/hg/file/42408cd43f55/hgext/mq.py
http://selenic.com/repo/hg/file/42408cd43f55/hgext/graphlog.py