[PATCH] error: use docstrings, not bare strings, for error classes

Martin Geisler martin at geisler.net
Sun Aug 31 04:12:06 CDT 2014


michaeljedgar at gmail.com writes:

> # HG changeset patch
> # User Mike Edgar <adgar at google.com>
> # Date 1409394140 -7200
> #      Sat Aug 30 12:22:20 2014 +0200
> # Node ID 67a45fae8b0e72895ea11a937153bc3130ecf48f
> # Parent  bdc0e04df243d3995c7266bf7d138fddd0449ba6
> error: use docstrings, not bare strings, for error classes

The quotes used actually make no difference:

  >>> def foo():
  ...   'a docstring'
  ...   pass
  ... 
  >>> def bar():
  ...   """another docstring"""
  ...   pass
  ... 
  >>> foo.__doc__
  'a docstring'
  >>> bar.__doc__
  'another docstring'

However, using triple-quoted strings is much more normal. I don't have
my SSH key on this machine, but if I had I would queue this :)

-- 
Martin Geisler

https://plus.google.com/+MartinGeisler/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20140831/5c431353/attachment.pgp>


More information about the Mercurial-devel mailing list