This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author dalloliogm
Recipients LambertDW, dalloliogm, rhettinger, tim.peters
Date 2009-01-13.14:03:41
SpamBayes Score 0.0486255
Marked as misclassified No
Message-id <>
I was proposing to adopt doctest in the biopython project (modules for
bioinformatics in python,

Doctest is very useful to document modules that will be used by many
other people: for example, there are many different file formats in
bioinformatics, and it is very useful to add an example of the file to
be parsed in the documentation of a file parser.
Look at my code here: 

However, it is very uncomfortable to have to create a file-like object
in every docstring, especially when you want to document the methods of
a class.
It would be useful if at least the doctests of the methods of a class
share the objects created in the main doctest of the class.

Let's say I have a class called FastaIO (fasta is a file format for
This module would have many methods: format, to_dict (returns a
dictionary of the sequences included in the file), and many others.
The main docstring of the class will have an example of a fasta file,
and shows how to create an instance of FastaIO.
It is silly to have to repeat this example (creating an instance of
FastaIO) in every submethod. Moreover, it is more difficult to maintain
and more error prone (imagine you have a class with one hundred methods).
Date User Action Args
2009-01-13 14:03:43dalloliogmsetrecipients: + dalloliogm, tim.peters, rhettinger, LambertDW
2009-01-13 14:03:43dalloliogmsetmessageid: <>
2009-01-13 14:03:42dalloliogmlinkissue4899 messages
2009-01-13 14:03:41dalloliogmcreate