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

Skip to content

Commit e6bcc91

Browse files
committed
Remove many "versionchanged" items that didn't use the official markup,
but just some text embedded in the docs. Also remove paragraph about implicit relative imports from tutorial.
1 parent c737283 commit e6bcc91

52 files changed

Lines changed: 148 additions & 470 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Doc/c-api/dict.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@ Dictionary Objects
153153
...
154154
}
155155

156-
The dictionary *p* should not be mutated during iteration. It is safe (since
157-
Python 2.1) to modify the values of the keys as you iterate over the dictionary,
158-
but only so long as the set of keys does not change. For example::
156+
The dictionary *p* should not be mutated during iteration. It is safe to
157+
modify the values of the keys as you iterate over the dictionary, but only so
158+
long as the set of keys does not change. For example::
159159

160160
PyObject *key, *value;
161161
Py_ssize_t pos = 0;

Doc/c-api/exceptions.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ in various ways. There is a separate error indicator for each thread.
147147
.. % The descriptions for %zd and %zu are wrong, but the truth is complicated
148148
.. % because not all compilers support the %z width modifier -- we fake it
149149
.. % when necessary via interpolating PY_FORMAT_SIZE_T.
150-
.. % %u, %lu, %zu should have "new in Python 2.5" blurbs.
151150
152151
+-------------------+---------------+--------------------------------+
153152
| Format Characters | Type | Comment |

Doc/c-api/import.rst

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@ Importing Modules
2222
be the case. (Unfortunately, this has an additional side effect when *name* in
2323
fact specifies a subpackage instead of a submodule: the submodules specified in
2424
the package's ``__all__`` variable are loaded.) Return a new reference to the
25-
imported module, or *NULL* with an exception set on failure. Before Python 2.4,
26-
the module may still be created in the failure case --- examine ``sys.modules``
27-
to find out. Starting with Python 2.4, a failing import of a module no longer
28-
leaves the module in ``sys.modules``.
25+
imported module, or *NULL* with an exception set on failure. A failing
26+
import of a module doesn't leave the module in :data:`sys.modules`.
2927

3028

3129
.. cfunction:: PyObject* PyImport_ImportModuleNoBlock(const char *name)
@@ -47,11 +45,11 @@ Importing Modules
4745
function :func:`__import__`, as the standard :func:`__import__` function calls
4846
this function directly.
4947

50-
The return value is a new reference to the imported module or top-level package,
51-
or *NULL* with an exception set on failure (before Python 2.4, the module may
52-
still be created in this case). Like for :func:`__import__`, the return value
53-
when a submodule of a package was requested is normally the top-level package,
54-
unless a non-empty *fromlist* was given.
48+
The return value is a new reference to the imported module or top-level
49+
package, or *NULL* with an exception set on failure. Like for
50+
:func:`__import__`, the return value when a submodule of a package was
51+
requested is normally the top-level package, unless a non-empty *fromlist*
52+
was given.
5553

5654
Failing imports remove incomplete module objects, like with
5755
:cfunc:`PyImport_ImportModule`.
@@ -106,9 +104,8 @@ Importing Modules
106104
Given a module name (possibly of the form ``package.module``) and a code object
107105
read from a Python bytecode file or obtained from the built-in function
108106
:func:`compile`, load the module. Return a new reference to the module object,
109-
or *NULL* with an exception set if an error occurred. Before Python 2.4, the
110-
module could still be created in error cases. Starting with Python 2.4, *name*
111-
is removed from :attr:`sys.modules` in error cases, and even if *name* was already
107+
or *NULL* with an exception set if an error occurred. *name*
108+
is removed from :attr:`sys.modules` in error cases, even if *name* was already
112109
in :attr:`sys.modules` on entry to :cfunc:`PyImport_ExecCodeModule`. Leaving
113110
incompletely initialized modules in :attr:`sys.modules` is dangerous, as imports of
114111
such modules have no way to know that the module object is an unknown (and
@@ -144,8 +141,6 @@ Importing Modules
144141
Cache the result in :data:`sys.path_importer_cache`. Return a new reference
145142
to the importer object.
146143

147-
.. versionadded:: 2.6
148-
149144

150145
.. cfunction:: void _PyImport_Init()
151146

Doc/c-api/init.rst

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -273,14 +273,14 @@ Initialization, Finalization, and Threads
273273
Return the version of this Python interpreter. This is a string that looks
274274
something like ::
275275

276-
"1.5 (#67, Dec 31 1997, 22:34:28) [GCC 2.7.2.2]"
276+
"3.0a5+ (py3k:63103M, May 12 2008, 00:53:55) \n[GCC 4.2.3]"
277277

278278
.. index:: single: version (in module sys)
279279

280280
The first word (up to the first space character) is the current Python version;
281281
the first three characters are the major and minor version separated by a
282282
period. The returned string points into static storage; the caller should not
283-
modify its value. The value is available to Python code as ``sys.version``.
283+
modify its value. The value is available to Python code as :data:`sys.version`.
284284

285285

286286
.. cfunction:: const char* Py_GetBuildNumber()
@@ -479,9 +479,9 @@ the lock, and finally storing their thread state pointer, before they can start
479479
using the Python/C API. When they are done, they should reset the thread state
480480
pointer, release the lock, and finally free their thread state data structure.
481481

482-
Beginning with version 2.3, threads can now take advantage of the
483-
:cfunc:`PyGILState_\*` functions to do all of the above automatically. The
484-
typical idiom for calling into Python from a C thread is now::
482+
Threads can take advantage of the :cfunc:`PyGILState_\*` functions to do all of
483+
the above automatically. The typical idiom for calling into Python from a C
484+
thread is now::
485485

486486
PyGILState_STATE gstate;
487487
gstate = PyGILState_Ensure();
@@ -777,14 +777,12 @@ The Python interpreter provides some low-level support for attaching profiling
777777
and execution tracing facilities. These are used for profiling, debugging, and
778778
coverage analysis tools.
779779

780-
Starting with Python 2.2, the implementation of this facility was substantially
781-
revised, and an interface from C was added. This C interface allows the
782-
profiling or tracing code to avoid the overhead of calling through Python-level
783-
callable objects, making a direct C function call instead. The essential
784-
attributes of the facility have not changed; the interface allows trace
785-
functions to be installed per-thread, and the basic events reported to the trace
786-
function are the same as had been reported to the Python-level trace functions
787-
in previous versions.
780+
This C interface allows the profiling or tracing code to avoid the overhead of
781+
calling through Python-level callable objects, making a direct C function call
782+
instead. The essential attributes of the facility have not changed; the
783+
interface allows trace functions to be installed per-thread, and the basic
784+
events reported to the trace function are the same as had been reported to the
785+
Python-level trace functions in previous versions.
788786

789787

790788
.. ctype:: int (*Py_tracefunc)(PyObject *obj, PyFrameObject *frame, int what, PyObject *arg)

Doc/c-api/marshal.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ back. Files used to store marshalled data must be opened in binary mode.
1313
Numeric values are stored with the least significant byte first.
1414

1515
The module supports two versions of the data format: version 0 is the historical
16-
version, version 1 (new in Python 2.4) shares interned strings in the file, and
17-
upon unmarshalling. *Py_MARSHAL_VERSION* indicates the current file format
18-
(currently 1).
16+
version, version 1 shares interned strings in the file, and upon unmarshalling.
17+
Version 2 uses a binary format for floating point numbers.
18+
*Py_MARSHAL_VERSION* indicates the current file format (currently 2).
1919

2020

2121
.. cfunction:: void PyMarshal_WriteLongToFile(long value, FILE *file, int version)

Doc/c-api/number.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,6 @@ Number Protocol
267267
base. If *n* is not an int object, it is converted with
268268
:cfunc:`PyNumber_Index` first.
269269

270-
.. versionadded:: 2.6
271-
272270

273271
.. cfunction:: Py_ssize_t PyNumber_AsSsize_t(PyObject *o, PyObject *exc)
274272

Doc/c-api/set.rst

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,6 @@ the constructor functions work with any iterable Python object.
9393
set on success or *NULL* on failure. Raise :exc:`TypeError` if *iterable* is
9494
not actually iterable.
9595

96-
.. versionchanged:: 2.6
97-
Now guaranteed to return a brand-new :class:`frozenset`. Formerly,
98-
frozensets of zero-length were a singleton. This got in the way of
99-
building-up new frozensets with :meth:`PySet_Add`.
10096

10197
The following functions and macros are available for instances of :class:`set`
10298
or :class:`frozenset` or instances of their subtypes.
@@ -127,16 +123,14 @@ or :class:`frozenset` or instances of their subtypes.
127123

128124
.. cfunction:: int PySet_Add(PyObject *set, PyObject *key)
129125

130-
Add *key* to a :class:`set` instance. Does not apply to :class:`frozenset`
131-
instances. Return 0 on success or -1 on failure. Raise a :exc:`TypeError` if
132-
the *key* is unhashable. Raise a :exc:`MemoryError` if there is no room to grow.
133-
Raise a :exc:`SystemError` if *set* is an not an instance of :class:`set` or its
126+
Add *key* to a :class:`set` instance. Also works with :class:`frozenset`
127+
instances (like :cfunc:`PyTuple_SetItem` it can be used to fill-in the values
128+
of brand new frozensets before they are exposed to other code). Return 0 on
129+
success or -1 on failure. Raise a :exc:`TypeError` if the *key* is
130+
unhashable. Raise a :exc:`MemoryError` if there is no room to grow. Raise a
131+
:exc:`SystemError` if *set* is an not an instance of :class:`set` or its
134132
subtype.
135133

136-
.. versionchanged:: 2.6
137-
Now works with instances of :class:`frozenset` or its subtypes.
138-
Like :cfunc:`PyTuple_SetItem` in that it can be used to fill-in the
139-
values of brand new frozensets before they are exposed to other code.
140134

141135
The following functions are available for instances of :class:`set` or its
142136
subtypes but not for instances of :class:`frozenset` or its subtypes.

Doc/c-api/slice.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@ Slice Objects
3838
indices was not :const:`None` and failed to be converted to an integer, in which
3939
case -1 is returned with an exception set).
4040

41-
You probably do not want to use this function. If you want to use slice objects
42-
in versions of Python prior to 2.3, you would probably do well to incorporate
43-
the source of :cfunc:`PySlice_GetIndicesEx`, suitably renamed, in the source of
44-
your extension.
41+
You probably do not want to use this function.
4542

4643

4744
.. cfunction:: int PySlice_GetIndicesEx(PySliceObject *slice, Py_ssize_t length, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, Py_ssize_t *slicelength)

Doc/c-api/string.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ called with a non-string parameter.
6363
.. % XXX: The descriptions for %zd and %zu are wrong, but the truth is complicated
6464
.. % because not all compilers support the %z width modifier -- we fake it
6565
.. % when necessary via interpolating PY_FORMAT_SIZE_T.
66-
.. % %u, %lu, %zu should have "new in Python 2.5" blurbs.
6766
6867
+-------------------+---------------+--------------------------------+
6968
| Format Characters | Type | Comment |

0 commit comments

Comments
 (0)