We're back after a server migration that caused effbot.org to fall over a bit harder than expected. Expect some glitches.


Built-in functions

A built-in function object is a wrapper around a C function. Examples of built-in functions are len and math.sin() (math is a standard built-in module). The number and type of the arguments are determined by the C function.

Special read-only attributes:

  • __doc__ is the function’s documentation string, or None if unavailable.
  • __name__ is the function’s name
  • __self__ is set to None (but see the next section)
  • __module__ is the name of the module the function was defined in or None if unavailable.

Built-in methods

This is really a different disguise of a built-in function, this time containing an object passed to the C function as an implicit extra argument. An example of a built-in method is alist.append(), assuming alist is a list object. In this case, the special read-only attribute __self__ is set to the object denoted by list.