@@ -508,9 +508,6 @@ Callable types
508508
509509 Most of the attributes labelled "Writable" check the type of the assigned value.
510510
511- .. versionchanged :: 2.4
512- ``__name__ `` is now writable.
513-
514511 Function objects also support getting and setting arbitrary attributes, which
515512 can be used, for example, to attach metadata to functions. Regular attribute
516513 dot-notation is used to get and set such attributes. *Note that the current
@@ -550,9 +547,6 @@ Callable types
550547 ``im_func.__name__ ``); :attr: `__module__ ` is the name of the module the method
551548 was defined in, or ``None `` if unavailable.
552549
553- .. versionchanged :: 2.2
554- :attr: `im_self ` used to refer to the class that defined the method.
555-
556550 .. index ::
557551 single: __doc__ (method attribute)
558552 single: __name__ (method attribute)
@@ -1029,8 +1023,6 @@ Internal types
10291023 slice. Missing or out-of-bounds indices are handled in a manner consistent with
10301024 regular slices.
10311025
1032- .. versionadded :: 2.3
1033-
10341026 Static method objects
10351027 Static method objects provide a way of defeating the transformation of function
10361028 objects to method objects described above. A static method object is a wrapper
@@ -1240,8 +1232,6 @@ Basic customization
12401232 object.__gt__(self, other)
12411233 object.__ge__(self, other)
12421234
1243- .. versionadded :: 2.1
1244-
12451235 These are the so-called "rich comparison" methods, and are called for comparison
12461236 operators in preference to :meth: `__cmp__ ` below. The correspondence between
12471237 operator symbols and method names is as follows: ``x<y `` calls ``x.__lt__(y) ``,
@@ -1286,17 +1276,12 @@ Basic customization
12861276 not propagated by :meth: `__cmp__ ` has been removed since Python 1.5.)
12871277
12881278
1289- .. method :: object.__rcmp__(self, other)
1290-
1291- .. versionchanged :: 2.1
1292- No longer supported.
1293-
1294-
12951279.. method :: object.__hash__(self)
12961280
12971281 .. index ::
12981282 object: dictionary
12991283 builtin: hash
1284+ single: __cmp__() (object method)
13001285
13011286 Called for the key object for dictionary operations, and by the built-in
13021287 function :func: `hash `. Should return a 32-bit integer usable as a hash value
@@ -1312,11 +1297,8 @@ Basic customization
13121297 key's hash value is immutable (if the object's hash value changes, it will be in
13131298 the wrong hash bucket).
13141299
1315- .. versionchanged :: 2.5
1316- :meth: `__hash__ ` may now also return a long integer object; the 32-bit integer
1317- is then derived from the hash of that object.
1318-
1319- .. index :: single: __cmp__() (object method)
1300+ :meth: `__hash__ ` may also return a long integer object; the 32-bit integer is
1301+ then derived from the hash of that object.
13201302
13211303
13221304.. method :: object.__bool__(self)
@@ -1502,30 +1484,21 @@ saved because *__dict__* is not created for each instance.
15021484 class, *__slots__ * reserves space for the declared variables and prevents the
15031485 automatic creation of *__dict__ * and *__weakref__ * for each instance.
15041486
1505- .. versionadded :: 2.2
15061487
15071488Notes on using *__slots__ *
1489+ """"""""""""""""""""""""""
15081490
15091491* Without a *__dict__ * variable, instances cannot be assigned new variables not
15101492 listed in the *__slots__ * definition. Attempts to assign to an unlisted
15111493 variable name raises :exc: `AttributeError `. If dynamic assignment of new
15121494 variables is desired, then add ``'__dict__' `` to the sequence of strings in
15131495 the *__slots__ * declaration.
15141496
1515- .. versionchanged :: 2.3
1516- Previously, adding ``'__dict__' `` to the *__slots__ * declaration would not
1517- enable the assignment of new attributes not specifically listed in the sequence
1518- of instance variable names.
1519-
15201497* Without a *__weakref__ * variable for each instance, classes defining
15211498 *__slots__ * do not support weak references to its instances. If weak reference
15221499 support is needed, then add ``'__weakref__' `` to the sequence of strings in the
15231500 *__slots__ * declaration.
15241501
1525- .. versionchanged :: 2.3
1526- Previously, adding ``'__weakref__' `` to the *__slots__ * declaration would not
1527- enable support for weak references.
1528-
15291502* *__slots__ * are implemented at the class level by creating descriptors
15301503 (:ref: `descriptors `) for each variable name. As a result, class attributes
15311504 cannot be used to set default values for instance variables defined by
@@ -1550,10 +1523,6 @@ Notes on using *__slots__*
15501523
15511524* *__class__ * assignment works only if both classes have the same *__slots__ *.
15521525
1553- .. versionchanged :: 2.6
1554- Previously, *__class__ * assignment raised an error if either new or old class
1555- had *__slots__ *.
1556-
15571526
15581527.. _metaclasses :
15591528
@@ -1581,8 +1550,6 @@ process:
15811550 and ``dict ``. Upon class creation, the callable is used instead of the built-in
15821551 :func: `type `.
15831552
1584- .. versionadded :: 2.2
1585-
15861553The appropriate metaclass is determined by the following precedence rules:
15871554
15881555* If ``dict['__metaclass__'] `` exists, it is used.
@@ -1967,16 +1934,12 @@ left undefined.
19671934 an integer object (such as in slicing, or in the built-in :func: `bin `,
19681935 :func: `hex ` and :func: `oct ` functions). Must return an integer (int or long).
19691936
1970- .. versionadded :: 2.5
1971-
19721937
19731938.. _context-managers :
19741939
19751940With Statement Context Managers
19761941-------------------------------
19771942
1978- .. versionadded :: 2.5
1979-
19801943A :dfn: `context manager ` is an object that defines the runtime context to be
19811944established when executing a :keyword: `with ` statement. The context manager
19821945handles the entry into, and the exit from, the desired runtime context for the
0 commit comments