[Biopython-dev] [Bug 2640] Proposal: doctest for SeqRecord/biopython

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Wed Nov 12 15:35:54 UTC 2008


http://bugzilla.open-bio.org/show_bug.cgi?id=2640





------- Comment #17 from dalloliogm at gmail.com  2008-11-12 10:35 EST -------
(In reply to comment #16)
> (In reply to comment #15)
> > I saw the changes now!
> 
> The CVS website is updated once an hour, you track this on
> http://biopython.org/wiki/Tracking_CVS_commits which displays the RSS feed,
> http://biopython.open-bio.org/CVS2RSS/biopython.rss (this works great apart
> from the links when more than one file is changed).
> 
> > ok.. But I would prefer to put the doctest in the main __doc__ of
> > the function instead of __init__ and __repr__.
> > This is because otherwise they wouldn't be accessible by the users with the
> > help function.  Usually you do help(SeqRecord), not help(SeqRecord.__init__).
> 
> If you do help(object) it shows you the main docstring followed by all the
> methods and their docstrings (including __init__).
> 
> On the other hand all the special methods like __init__, __str__, __repr__ etc
> are going to be confusing for a beginner.
> 
> On balance, a short example in the main docstring (covering __init__) does seem
> sensible, and perhaps the __init__ example is then redundant.

well, I was saying that maybe it would be better to move the doctests in
__init__ and __repr__ to the main __doc__ of the module.
So it will be visible by people using help(module). 
Moreover, you can to test __repr__ and __init__ from there, without having to
repeat the 'from Bio.ALign.Generic import Alignment' stuff and similar every
time.


as for a few comments you added in Bio.Align.Generic:

> #A doctest for __repr__ would be nice, but __class__ comes out differently
> #if run via the __main__ trick.

maybe you can use the '+ELLIPSIS' directive 

and about this comment:
#A doctest would be nice, but the <BLANKLINE> stuff is very ugly!
#The "tab" format is possible, but tabs don't seem to work nicely in doctests.

you could use the directive NORMALIZE_WHITESPACE in a similar way.
I am attaching a file just to give you an example of how it could be with
+ELLIPSIS


> Does anyone else want to comment?
> 


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Biopython-dev mailing list