From: Christian Herdtweck Date: Thu, 10 Sep 2015 15:52:11 +0000 (+0200) Subject: added constants to template X-Git-Tag: v1.2~107 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=f6de3ec0a20ddd7c0ef6cd0bec96b38695233596;p=pyi2ncommon added constants to template --- diff --git a/template.py b/template.py index f61c870..1ad91c2 100644 --- a/template.py +++ b/template.py @@ -34,6 +34,15 @@ in this docstring, but please keep it brief! .. codeauthor:: John Doe, john.doe@intra2net.com """ +THE_CONSTANT = None +""" some constant with docstring *AFTER* the constant. Use this format! """ + + +ANOTHER_CONSTANT = 1 #: short docstring in same line -- note the #: + +#: constant with docstring in line above it -- note the #: +THIRD_CONST = 3.333 + class TestClass: """ @@ -71,6 +80,11 @@ def send_message(sender, recipient, message_body, priority=1): Does not use :py:class:`TestClass` at all. Also has nothing to do with the python module :py:mod:`logging.handlers` + Note that it is completely irrelevant what :py:data:`THE_CONSTANT` or + :py:data:`ANOTHER_CONSTANT` or :py:data:`THIRD_CONSTANT` are set to. I just + wanted to insert a link to a constant somewhere and find out how to + document constants + :param str sender: The person sending the message :param str recipient: The recipient of the message :param str message_body: The body of the message