12.07.2015 Views

Is Python a

Is Python a

Is Python a

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ChapterCHAPTER1414The Documentation Interlude 14This chapter concludes Part III with a look at techniques and tools used fordocumenting <strong>Python</strong> code. Although <strong>Python</strong> code is designed to be readable, a fewwell-placed human-readable comments can do much to help others understand theworkings of your programs. <strong>Python</strong> includes syntax and tools to make documentationeasier.Although this is something of a tools-related concept, the topic is presented herepartly because it involves <strong>Python</strong>’s syntax model, and partly as a resource for readersstruggling to understand <strong>Python</strong>’s toolset. For the latter purpose, I’ll expand here ondocumentation pointers first given in Chapter 4. As usual, this chapter ends withsome warnings about common pitfalls, a chapter quiz, and a set of exercises for thispart of the text.<strong>Python</strong> Documentation SourcesBy this point in the book, you’re probably starting to realize that <strong>Python</strong> comes withan amazing amount of prebuilt functionality—built-in functions and exceptions,predefined object attributes and methods, standard library modules, and more.Moreover, we’ve really only scratched the surface of each of these categories.One of the first questions that bewildered beginners often ask is: how do I findinformation on all the built-in tools? This section provides hints on the various documentationsources available in <strong>Python</strong>. It also presents documentation strings(docstrings), and the PyDoc system that makes use of them. These topics are somewhatperipheral to the core language itself, but they become essential knowledge assoon as your code reaches the level of the examples and exercises in this part of thebook.278

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!