My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
HowToDocStrings  

Featured
Updated Feb 4, 2010 by crak.otaku

Tips for coding good docstrings.

Multi-line docstrings consist of:

  • Summary line
  • Blank line
  • Arguments: not just the type, but in detail.
  • Return values: not just the type, but in detail.

Example:

def manage_packages(self, packages, packages_info):
	"""Creates the directory of download and the password for the package if needed.

	packages: list of 5-tuple (str::link, str::file_name, int::size, str::size_unit, str::plugin_type)
	packages_info: list of 3-tuple (str::path, str::name, str::password)
	"""

More info: http://www.python.org/dev/peps/pep-0257/


Sign in to add a comment
Powered by Google Project Hosting