Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1617457

Browse files
committed
Remove versionadded/versionchanged in the reference.
1 parent 321976b commit 1617457

3 files changed

Lines changed: 5 additions & 57 deletions

File tree

Doc/reference/compound_stmts.rst

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ The :keyword:`try` statement
211211
============================
212212

213213
.. index:: statement: try
214+
.. index:: keyword: except
214215

215216
The :keyword:`try` statement specifies exception handlers and/or cleanup code
216217
for a group of statements:
@@ -224,13 +225,6 @@ for a group of statements:
224225
try2_stmt: "try" ":" `suite`
225226
: "finally" ":" `suite`
226227

227-
.. versionchanged:: 2.5
228-
In previous versions of Python, :keyword:`try`...\ :keyword:`except`...\
229-
:keyword:`finally` did not work. :keyword:`try`...\ :keyword:`except` had to be
230-
nested in :keyword:`try`...\ :keyword:`finally`.
231-
232-
.. index:: keyword: except
233-
234228
The :keyword:`except` clause(s) specify one or more exception handlers. When no
235229
exception occurs in the :keyword:`try` clause, no exception handler is executed.
236230
When an exception occurs in the :keyword:`try` suite, a search for an exception
@@ -317,8 +311,6 @@ The :keyword:`with` statement
317311

318312
.. index:: statement: with
319313

320-
.. versionadded:: 2.5
321-
322314
The :keyword:`with` statement is used to wrap the execution of a block with
323315
methods defined by a context manager (see section :ref:`context-managers`). This
324316
allows common :keyword:`try`...\ :keyword:`except`...\ :keyword:`finally` usage

Doc/reference/datamodel.rst

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -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

15071488
Notes 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-
15861553
The 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

19751940
With Statement Context Managers
19761941
-------------------------------
19771942

1978-
.. versionadded:: 2.5
1979-
19801943
A :dfn:`context manager` is an object that defines the runtime context to be
19811944
established when executing a :keyword:`with` statement. The context manager
19821945
handles the entry into, and the exit from, the desired runtime context for the

Doc/reference/expressions.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,6 @@ Yield expressions
294294
yield_atom: "(" `yield_expression` ")"
295295
yield_expression: "yield" [`expression_list`]
296296

297-
.. versionadded:: 2.5
298-
299297
The :keyword:`yield` expression is only used when defining a generator function,
300298
and can only be used in the body of a function definition. Using a
301299
:keyword:`yield` expression in a function definition is sufficient to cause that
@@ -1024,9 +1022,6 @@ substring of *y*. An equivalent test is ``y.find(x) != -1``. Empty strings are
10241022
always considered to be a substring of any other string, so ``"" in "abc"`` will
10251023
return ``True``.
10261024

1027-
.. versionchanged:: 2.3
1028-
Previously, *x* was required to be a string of length ``1``.
1029-
10301025
For user-defined classes which define the :meth:`__contains__` method, ``x in
10311026
y`` is true if and only if ``y.__contains__(x)`` is true.
10321027

@@ -1089,8 +1084,6 @@ The expression ``x if C else y`` first evaluates *C* (*not* *x*); if *C* is
10891084
true, *x* is evaluated and its value is returned; otherwise, *y* is evaluated
10901085
and its value is returned.
10911086

1092-
.. versionadded:: 2.5
1093-
10941087
.. index:: operator: and
10951088

10961089
The expression ``x and y`` first evaluates *x*; if *x* is false, its value is

0 commit comments

Comments
 (0)