Open GoogleCodeExporter opened 9 years ago
Specifically, we've got a lot of cases where a function looks like this:
# Here's a comment describing what the function does,
# how to use it, and so on.
def my_function(...)
do_stuff()
These should be converted to this:
def my_function(...)
"""The comment description has been moved into a
docstring. This is more useful, because Python
understands these and uses them to answer calls
to help().
Additionally, Python code management tools will
often use these much like Java's JavaDoc system,
to build external documentation."""
do_stuff()
Original comment by funnyman3595
on 1 May 2008 at 6:20
The attachment is a bash script that converts the code to the docstring format.
It doesn't overwrite the code, but places the converted code in the directory
'conv/'. Don't forget to edit the BASE_DIR variable.
Known issue: __init__ is not allowed to have a docstring, but this script
ignores that.
Original comment by tinu...@skynet.be
on 1 May 2008 at 11:00
Attachments:
The attachment is a newer version of the sed script, which handles __init__
correctly.
Original comment by tinu...@skynet.be
on 2 May 2008 at 9:03
Attachments:
Original comment by funnyman3595
on 16 May 2008 at 1:22
Shifting to next release milestone.
Original comment by phil.bor...@gmail.com
on 27 Jan 2009 at 12:36
Original issue reported on code.google.com by
tinu...@skynet.be
on 1 May 2008 at 6:12