# HG changeset patch # Parent f0ca1fabb41f56460d557f663dd1fdd28f5d332c diff -r f0ca1fabb41f Doc/c-api/typeobj.rst --- a/Doc/c-api/typeobj.rst Tue Jun 23 20:48:52 2015 -0700 +++ b/Doc/c-api/typeobj.rst Wed Jun 24 04:10:59 2015 +0000 @@ -641,6 +641,8 @@ referenceable by adding a weak reference list head slot to the instance layout and setting the :c:member:`~PyTypeObject.tp_weaklistoffset` of that slot's offset. + .. index:: __weakref__ (object attribute) + When a type's :attr:`__slots__` declaration contains a slot named :attr:`__weakref__`, that slot becomes the weak reference list head for instances of the type, and the slot's offset is stored in the type's diff -r f0ca1fabb41f Doc/library/abc.rst --- a/Doc/library/abc.rst Tue Jun 23 20:48:52 2015 -0700 +++ b/Doc/library/abc.rst Wed Jun 24 04:10:59 2015 +0000 @@ -197,6 +197,8 @@ ... x = property(_get_x, _set_x) + .. index:: __isabstractmethod__ (descriptor attribute) + In order to correctly interoperate with the abstract base class machinery, the descriptor must identify itself as abstract using :attr:`__isabstractmethod__`. In general, this attribute should be ``True`` diff -r f0ca1fabb41f Doc/library/dis.rst --- a/Doc/library/dis.rst Tue Jun 23 20:48:52 2015 -0700 +++ b/Doc/library/dis.rst Wed Jun 24 04:10:59 2015 +0000 @@ -636,6 +636,8 @@ .. opcode:: LOAD_BUILD_CLASS + .. index:: builtin: __build_class__ + Pushes :func:`builtins.__build_class__` onto the stack. It is later called by :opcode:`CALL_FUNCTION` to construct a class. diff -r f0ca1fabb41f Doc/library/doctest.rst --- a/Doc/library/doctest.rst Tue Jun 23 20:48:52 2015 -0700 +++ b/Doc/library/doctest.rst Wed Jun 24 04:10:59 2015 +0000 @@ -267,6 +267,8 @@ The module docstring, and all function, class and method docstrings are searched. Objects imported into the module are not searched. +.. index:: __test__ (module attribute) + In addition, if ``M.__test__`` exists and "is true", it must be a dict, and each entry maps a (string) name to a function object, class object, or string. Function and class object docstrings found from ``M.__test__`` are searched, and diff -r f0ca1fabb41f Doc/library/enum.rst --- a/Doc/library/enum.rst Tue Jun 23 20:48:52 2015 -0700 +++ b/Doc/library/enum.rst Wed Jun 24 04:10:59 2015 +0000 @@ -220,6 +220,8 @@ >>> list(Shape) [, , ] +.. index:: __members__ (enum.Enum attribute) + The special attribute ``__members__`` is an ordered dictionary mapping names to members. It includes all names defined in the enumeration, including the aliases:: diff -r f0ca1fabb41f Doc/library/functools.rst --- a/Doc/library/functools.rst Tue Jun 23 20:48:52 2015 -0700 +++ b/Doc/library/functools.rst Wed Jun 24 04:10:59 2015 +0000 @@ -68,6 +68,8 @@ The decorator also provides a :func:`cache_clear` function for clearing or invalidating the cache. + .. index:: __wrapped__ (function attribute) + The original underlying function is accessible through the :attr:`__wrapped__` attribute. This is useful for introspection, for bypassing the cache, or for rewrapping the function with a different cache. @@ -380,6 +382,8 @@ documentation string) and *WRAPPER_UPDATES* (which updates the wrapper function's *__dict__*, i.e. the instance dictionary). + .. index:: __wrapped__ (function attribute) + To allow access to the original function for introspection and other purposes (e.g. bypassing a caching decorator such as :func:`lru_cache`), this function automatically adds a ``__wrapped__`` attribute to the wrapper that refers to diff -r f0ca1fabb41f Doc/library/inspect.rst --- a/Doc/library/inspect.rst Tue Jun 23 20:48:52 2015 -0700 +++ b/Doc/library/inspect.rst Wed Jun 24 04:10:59 2015 +0000 @@ -947,6 +947,8 @@ Get the object wrapped by *func*. It follows the chain of :attr:`__wrapped__` attributes returning the last object in the chain. + .. index:: __signature__ (object attribute) + *stop* is an optional callback accepting an object in the wrapper chain as its sole argument that allows the unwrapping to be terminated early if the callback returns a true value. If the callback never returns a true diff -r f0ca1fabb41f Doc/library/math.rst --- a/Doc/library/math.rst Tue Jun 23 20:48:52 2015 -0700 +++ b/Doc/library/math.rst Wed Jun 24 04:10:59 2015 +0000 @@ -175,6 +175,8 @@ .. function:: trunc(x) + .. index:: __trunc__() (object method) + Return the :class:`~numbers.Real` value *x* truncated to an :class:`~numbers.Integral` (usually an integer). Delegates to ``x.__trunc__()``. diff -r f0ca1fabb41f Doc/library/sqlite3.rst --- a/Doc/library/sqlite3.rst Tue Jun 23 20:48:52 2015 -0700 +++ b/Doc/library/sqlite3.rst Wed Jun 24 04:10:59 2015 +0000 @@ -757,6 +757,8 @@ type to one of the supported ones. +.. index:: __conform__() + Letting your object adapt itself """""""""""""""""""""""""""""""" diff -r f0ca1fabb41f Doc/library/sys.rst --- a/Doc/library/sys.rst Tue Jun 23 20:48:52 2015 -0700 +++ b/Doc/library/sys.rst Wed Jun 24 04:10:59 2015 +0000 @@ -470,6 +470,8 @@ If given, *default* will be returned if the object does not provide means to retrieve the size. Otherwise a :exc:`TypeError` will be raised. + .. index:: __sizeof__() (object method) + :func:`getsizeof` calls the object's ``__sizeof__`` method and adds an additional garbage collector overhead if the object is managed by the garbage collector. diff -r f0ca1fabb41f Doc/library/warnings.rst --- a/Doc/library/warnings.rst Tue Jun 23 20:48:52 2015 -0700 +++ b/Doc/library/warnings.rst Wed Jun 24 04:10:59 2015 +0000 @@ -321,6 +321,8 @@ .. function:: warn_explicit(message, category, filename, lineno, module=None, registry=None, module_globals=None) + .. index:: __warningregistry__ (module attribute) + This is a low-level interface to the functionality of :func:`warn`, passing in explicitly the message, category, filename and line number, and optionally the module name and the registry (which should be the ``__warningregistry__`` diff -r f0ca1fabb41f Doc/reference/datamodel.rst --- a/Doc/reference/datamodel.rst Tue Jun 23 20:48:52 2015 -0700 +++ b/Doc/reference/datamodel.rst Wed Jun 24 04:10:59 2015 +0000 @@ -1488,6 +1488,8 @@ Called to delete the attribute on an instance *instance* of the owner class. +.. index:: __objclass__ (descriptor attribute) + The attribute :attr:`__objclass__` is interpreted by the :mod:`inspect` module as specifying the class where this object was defined (setting this appropriately can assist in runtime introspection of dynamic class attributes). @@ -1676,6 +1678,7 @@ that criterion, then the class definition will fail with ``TypeError``. +.. index:: __prepare__() (type method) .. _prepare: Preparing the class namespace diff -r f0ca1fabb41f Doc/reference/executionmodel.rst --- a/Doc/reference/executionmodel.rst Tue Jun 23 20:48:52 2015 -0700 +++ b/Doc/reference/executionmodel.rst Wed Jun 24 04:10:59 2015 +0000 @@ -117,7 +117,9 @@ .. XXX document "nonlocal" semantics here -.. index:: pair: restricted; execution +.. index:: + single: __builtins__ (module attribute) + pair: restricted; execution The builtins namespace associated with the execution of a code block is actually found by looking up the name ``__builtins__`` in its global namespace; this diff -r f0ca1fabb41f Doc/tutorial/modules.rst --- a/Doc/tutorial/modules.rst Tue Jun 23 20:48:52 2015 -0700 +++ b/Doc/tutorial/modules.rst Wed Jun 24 04:10:59 2015 +0000 @@ -189,6 +189,8 @@ "Compiled" Python files ----------------------- +.. index:: pair: __pycache__; directory + To speed up loading modules, Python caches the compiled version of each module in the ``__pycache__`` directory under the name :file:`module.{version}.pyc`, where the version encodes the format of the compiled file; it generally contains