diff -r 1f27572a10ce Doc/library/types.rst --- a/Doc/library/types.rst Wed Aug 22 23:34:50 2012 -0700 +++ b/Doc/library/types.rst Thu Aug 23 03:35:04 2012 -0700 @@ -74,27 +74,38 @@ Standard names are defined for the following types: -.. data:: FunctionType - LambdaType +.. class:: FunctionType(code, globals) + + Create a function object from a code object and a dictionary. + The optional name string overrides the name from the code object. + The optional argdefs tuple specifiees the default argument values. + The optional closure tuple supplies the bindings for free variables. + The type of user-defined functions and functions created by :keyword:`lambda` expressions. +.. class:: LambdaType(code, globals) + .. data:: GeneratorType The type of :term:`generator`-iterator objects, produced by calling a generator function. -.. data:: CodeType +.. class:: CodeType(argcount, kwonlyargcount, nlocals, stacksize, flags, codestring, constants, names, varnames, filename, name, firstlineno, lnotab) + + Create a code object. Not for the faint of heart. .. index:: builtin: compile The type for code objects such as returned by :func:`compile`. -.. data:: MethodType +.. class:: MethodType(function, instance) + + Create a bound instance method object. The type of methods of user-defined class instances. @@ -146,8 +157,8 @@ .. class:: MappingProxyType(mapping) Read-only proxy of a mapping. It provides a dynamic view on the mapping's - entries, which means that when the mapping changes, the view reflects these - changes. + entries, which means that when the mapping changes, the view reflects + these changes. .. versionadded:: 3.3 @@ -196,6 +207,10 @@ .. class:: SimpleNamespace + A simple attribute-based namespace. + + namespace(**kwargs) + A simple :class:`object` subclass that provides attribute access to its namespace, as well as a meaningful repr.