pydoc preference for triple double over triple single quotes -- any reason?

Thomas Rast foo.bar at freesurf.ch.invalid
Sat Apr 16 15:54:46 EDT 2005


Brian van den Broek <bvande at po-box.mcgill.ca> writes:

> It turns out that I was using '''triple single quotes''' and pydoc
> only pulls a description out from module docstrings that are formatted
> in """triple double quotes""". I've poked about with google, and
> cannot find any explanation of why pydoc should treat the two cases
> differently. Anyone have an idea?

Maybe because some editors, e.g. Emacs, do not (cannot) properly
handle triple quotes in syntax analysis and highlighting.  Instead,
the quotes are treated as ordinary quotes, which breaks

  '''This doesn't work'''

but not

  """This'll work"""

due to the apostrophe.  pydoc then probably decided to follow PEP 257
which says

  For consistency, always use """triple double quotes""" around
  docstrings.
  [http://www.python.org/peps/pep-0257.html]

- Thomas

-- 
If you want to reply by mail, substitute my first and last name for
'foo' and 'bar', respectively, and remove '.invalid'.



More information about the Python-list mailing list