News for hackers. Stuff that matters.
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
Re:Ask HN: Good Python codebases to read? by andreasvc on Thursday July 16, 2015 @07:26PM (#9900482)
I would do simply """f docstring\n%s""" % _shared_docstring, no need for a separate concatenation. However, I wonder whether sphinx would handle this.
Re:Ask HN: Good Python codebases to read? by shoyer on Friday July 17, 2015 @03:31AM (#9901630)
This sort of thing works fine. We use it for pandas all the time.