[I18n-sig] Re: Patch 101320: doc strings

François Pinard pinard@iro.umontreal.ca
04 Sep 2000 10:06:40 -0400


[Martin von Loewis]

> [François Pinard]
> > "_(__doc__)" should work if the docstring shares the textual domain of
> > the rest of the module, which looks like the correct thing to do in
> > my eyes.

> I don't see how this could work for doc strings of classes, methods
> and functions. Do you propose to write

> def foo():
>   _("This does the foo thing.")
>   pass

> That won't work; the parser won't recognize it as a doc string.

Of course.  The idea is to write:

    def foo():
        "This does the foo thing."
        pass

and at some later place:

    print _(foo.__doc__)

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard