Where to put the docstring in a module?

276 views
Skip to first unread message

Boštjan Mejak

unread,
Aug 9, 2013, 7:13:59 AM8/9/13
to wxPython Users Mailing List
Where is the most common place that you people put module docstrings in your source code files?

Is it right after the shebang line and before the copyright notice, or perhaps after the copyright notice and before imports?

Thanks.

werner

unread,
Aug 9, 2013, 7:42:16 AM8/9/13
to wxpytho...@googlegroups.com
On 09/08/2013 13:13, Boštjan Mejak wrote:
Where is the most common place that you people put module docstrings in your source code files?

Is it right after the shebang line and before the copyright notice, or perhaps after the copyright notice and before imports?
http://www.python.org/dev/peps/pep-0257/
Quote from above:

What is a Docstring?

A docstring is a string literal that occurs as the first statement in a module, function, class, or method definition. Such a docstring becomes the __doc__ special attribute of that object.

Following might also be interesting/useful.

http://www.python.org/dev/peps/pep-0008/#documentation-strings
http://wxpython.org/Phoenix/docs/html/DocstringsGuidelines.html
http://sphinx-doc.org/ext/autodoc.html

Werner

"Boštjan Mejak"

unread,
Aug 9, 2013, 11:28:20 AM8/9/13
to wxpytho...@googlegroups.com
I am not satisfied with the links, but thanks for the effort. Ignore any written specifications or conventions on this topic. I wanna know in what order people, that are hacking using Python/wxPython, in general put stuff into a module. Firstly is always the shebang line (or is even skipped), then comes the multi-line docstring, then follows the copyright notice (written as a comment block), then constants and after that imports come, then class definitions...

Does anyone use any other order by which he/she inputs the aforesaid things into his/her new module?
Reply all
Reply to author
Forward
0 new messages