Page 434 - Beginning Programming with Pyth - John Paul Mueller
P. 434

developer. User documentation shows how to use the application, while developer documentation shows how the application works. A library requires only one sort of documentation, developer, while a desktop application may require only user documentation. A service might actually require both kinds of documentation depending on who uses it and how the service is put together. The majority of your documentation is likely to affect developers, and pdoc (https://github.com/BurntSushi/pdoc) is a simple solution for creating it.
The pdoc utility relies on the documentation that you place in your code in the form of docstrings and comments. The output is in the form of a text file or an HTML document. You can also have pdoc run in a way that provides output through a web server so that people can see the documentation directly in a browser. This is actually a replacement for epydoc, which is no longer supported by its originator.
Chapter 5 docstring is a special """This is a docstring."""
__doc__() MyClass help(MyClass)
Developing Application Code by Using Komodo Edit
Several chapters in this book discuss the issue of Interactive Development Environments (IDEs), but none make a specific recommendation (except for the use of Jupyter Notebook throughout the
  WHAT IS A DOCSTRING?
  and this chapter both talk about document strings (docstrings). A
  kind of comment that appears within a triple quote, like this:
 You associate a docstring with an object, such as packages, functions, classes, and methods. Any
 code object you can create in Python can have a docstring. The purpose of a docstring is to
 document the object. Consequently, you want to use descriptive sentences.
 The easiest way to see a docstring is to follow the object’s name with the special
  method. For example, typing
print(MyClass.__doc__())
would display the docstring for
  . You can also access a docstring by using help, such as
. Good
 docstrings tell what the object does, rather than how it does it.
 Third-party utilities can also make use of docstrings. Given the right utility, you can write the
 documentation for an entire library without actually having to write anything. The utility uses the
 docstrings within your library to create the documentation. Consequently, even though
 docstrings and comments are used for different purposes, they're equally important in your
 Python code.











































































   432   433   434   435   436