2007年06月22日 星期五 11:58
from gettext import gettext as _
__doc__ = _("""module docstrings""")
class test:
__doc__ = _("""class docstrings""")
def __setattr__(self, attr_name, value):
_("""class method docstrings""")
ÎÒ·¢ÏÖÖ»ÓÐ module ºÍ class docstrings ÓÐЧ(±ØÐë __doc__ À´Ã÷ȷ˵Ã÷), ¶ø class-method gettext
docstrings ûÓÐ×÷Ó㬵±ÎÒʹÓà help(test) µÄʱºò²»»áÏÔʾ£¬help(test.__setattr__) Ò²Ö»»á´òÓ¡ None,
Ö»ÓÐ:
def __setattr__(self, attr_name, value):
"""class method only english docstrings"""
has effect.
ÇëÎÊÓÐʲô°ì·¨£¿
Thanks.
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20070622/c4078fad/attachment.htm
Zeuux © 2025
京ICP备05028076号