Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #53395

Re: Best practice for generalizing and documenting each method's behaviour

References <b9541a34-734c-4402-a097-340781dfe34e@googlegroups.com>
Date 2013-09-01 03:31 +0100
Subject Re: Best practice for generalizing and documenting each method's behaviour
From Fábio Santos <fabiosantosart@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.436.1378002680.19984.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On 30 Aug 2013 19:07, <niubao56@gmail.com> wrote:
>
> I'm starting a small project coding in Python as I learn the ropes. As
the project grows bigger, there are more and more overlapping and even
redundant methods. For example, several classes have a
checkAndClean_obj_state() method. If just one or two such classes, it is
easy to analyze the behaviour of them and design the optimal interaction
for all objects. However, when there are many of such classes, exactly at
what point to invoke check and clean behaviour becomes a little blurred.
There is a desperate need for generalizing and documenting the behaviour of
each such class, preferably in a flowchart. I'm currently doing the
flowchart manually but the job becomes a bit overwhelming.
>
> I wonder what Python pros are using for analyzing and documenting
classes/functions behaviours and interactions? Is UML the only way?
Personally I found UML is a bit overkill for a one person project, but I'm
not sure if it is the right direction. I'd appreciate any insight. Many
thanks.

I can't say I have ever used any tool for documenting python automatically.
Human written documentation is always best.

As for graphs and all, YMMV, but I've found that paper is best for
expressing your code structure. I have looked into tools which generate
graphs of your imports, but I found none of them satisfactory. There are a
lot of problems parsing python due to its dynamic nature. In the end I
decided to sit and read my codebase as I drew.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Best practice for generalizing and documenting each method's behaviour niubao56@gmail.com - 2013-08-30 11:04 -0700
  Re: Best practice for generalizing and documenting each method's behaviour Fábio Santos <fabiosantosart@gmail.com> - 2013-09-01 03:31 +0100
  Re: Best practice for generalizing and documenting each method's behaviour Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-09-01 04:29 +0000

csiph-web