Re:Ask HN: Good Python codebases to read?
by merlincorey on Thursday July 16, 2015 @02:34PM
(#9899071)
You'd probably want to make a metaclass that handled the manipulation of __doc__ for shared verbs if you didn't want to duplicate the data too much.
[ Parent
| on HN ]
Re:Ask HN: Good Python codebases to read?
by Myrmornis on Thursday July 16, 2015 @05:40PM
(#9900032)
OK, but in requests they are top-level functions, not methods. Is there anything wrong with the below? I don't think I've seen it done.
__shared_docstring_content = """
bar
baz
"""
def f():
"f docstring"
pass
f.__doc__ += __shared_docstring_content
def g():
"g docstring"
pass
g.__doc__ += __shared_docstring_content