diff -r cfb11045fc8a Doc/library/types.rst --- a/Doc/library/types.rst Fri Aug 24 18:36:31 2012 +1000 +++ b/Doc/library/types.rst Fri Aug 24 03:01:23 2012 -0700 @@ -74,27 +74,40 @@ Standard names are defined for the following types: -.. data:: FunctionType - LambdaType +.. class:: FunctionType(code, globals) +.. class:: LambdaType(code, globals) + + LambaType is a synonym for FunctionType() + + 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. + .. 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 +159,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 +209,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.