Menu

#15 Comments should produce Python docstrings

open
nobody
None
5
2012-09-27
2004-12-15
Anonymous
No

In dia you can enter a comment for the class in the
class diagram as well as comments for each attribute
and operation (aka method).

It would be very useful, if dia2code included this
comment as the docstring of the class or method when
generating Python code. As attributes can have no
docstrings, the comment should be a comment in the
python source code itself immediately preceding the
attribute. This way, epydoc, for example, will pick up
the comment as the documentaion for the attribute.

The generated code will the look like this

class ClassName:
"""Comment for class ClassName.

Class ClassName
"""
# Attributes:

# Comment fro attribute id.
id = None  # (int)

# Operations
def spamm(self):
    """Comment for operation spamm.

    returns None
    """

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.