Examining a module

The_buiitins_module defines some exceptions (error-handling code), functions, and constants. To see what's in the_buiitins_module, simply type dir( buiitins ) .

There are a lot of things in that_buiitins_module! The following example shows the contents of the credits constant for Python 2.5. (A constant, like a name, stores data, but the data inside a constant shouldn't be changed.)

Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands for supporting Python development. See www.python.org for more information.

The capitalized names in the_builtins_module are exceptions, messages that Python sends when it encounters errors and other unusual conditions. These are all part of a module called exceptions, which you can see if you type one of the names into interactive mode:

>>> ArithmeticError

<type 'exceptions.ArithmeticError']

Was this article helpful?

0 0

Post a comment