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

Skip to content

Commit 4fbc72b

Browse files
committed
Merged revisions 61687-61688,61696,61700,61704-61705,61707-61709,61711-61712,61714-61716,61718-61722 via svnmerge from
svn+ssh://[email protected]/python/trunk ........ r61687 | jeffrey.yasskin | 2008-03-21 06:02:44 +0100 (Fri, 21 Mar 2008) | 2 lines Speed up test_signal from ~24s to 4s by avoiding nearly all of the sleep calls. ........ r61688 | jeffrey.yasskin | 2008-03-21 06:51:37 +0100 (Fri, 21 Mar 2008) | 5 lines Try to fix test_signal breakages on Linux due to r61687. It appears that at least two of the linux build bots aren't leaving zombie processes around for os.waitpid to wait for, causing ECHILD errors. This would be a symptom of a bug somewhere, but probably not in signal itself. ........ r61696 | georg.brandl | 2008-03-21 15:32:33 +0100 (Fri, 21 Mar 2008) | 2 lines Mark the descitems in the tutorial as "noindex" so that :meth: cross-refs don't link to them. ........ r61700 | georg.brandl | 2008-03-21 18:19:29 +0100 (Fri, 21 Mar 2008) | 2 lines Fix markup. ........ r61704 | jeffrey.yasskin | 2008-03-21 19:25:06 +0100 (Fri, 21 Mar 2008) | 3 lines Try to fix test_signal on FreeBSD. I'm assuming that os.kill is failing to raise a signal, but switching to subprocess makes the code cleaner anyway. ........ r61705 | jeffrey.yasskin | 2008-03-21 19:48:04 +0100 (Fri, 21 Mar 2008) | 7 lines Speed test_threading up from 14s to .5s, and avoid a deadlock on certain failures. The test for enumerate-after-join is now a little less rigorous, but the bug it references says the error happened in the first couple iterations, so 100 iterations should still be enough. cProfile was useful for identifying the slow tests here. ........ r61707 | georg.brandl | 2008-03-21 20:14:38 +0100 (Fri, 21 Mar 2008) | 2 lines Fix a code block in __future__ docs. ........ r61708 | georg.brandl | 2008-03-21 20:20:21 +0100 (Fri, 21 Mar 2008) | 2 lines Add docs for __func__ and __self__ on methods. ........ r61709 | georg.brandl | 2008-03-21 20:37:57 +0100 (Fri, 21 Mar 2008) | 2 lines Add docs for print_function and future_builtins. Fixes #2442. ........ r61711 | georg.brandl | 2008-03-21 20:54:00 +0100 (Fri, 21 Mar 2008) | 2 lines #2136: allow single quotes in realm spec. ........ r61712 | georg.brandl | 2008-03-21 21:01:51 +0100 (Fri, 21 Mar 2008) | 3 lines Issue #2432: give DictReader the dialect and line_num attributes advertised in the docs. ........ r61714 | georg.brandl | 2008-03-21 21:11:46 +0100 (Fri, 21 Mar 2008) | 2 lines #2358: add py3k warning to sys.exc_clear(). ........ r61715 | georg.brandl | 2008-03-21 21:21:46 +0100 (Fri, 21 Mar 2008) | 2 lines #2346/#2347: add py3k warning for __methods__ and __members__. Patch by Jack Diederich. ........ r61716 | georg.brandl | 2008-03-21 21:38:24 +0100 (Fri, 21 Mar 2008) | 2 lines #2348: add py3k warning for file.softspace. ........ r61718 | georg.brandl | 2008-03-21 21:55:20 +0100 (Fri, 21 Mar 2008) | 2 lines #2160: document PyImport_GetImporter. ........ r61719 | georg.brandl | 2008-03-21 21:55:51 +0100 (Fri, 21 Mar 2008) | 2 lines Update doc ACKS. ........ r61720 | steven.bethard | 2008-03-21 22:01:18 +0100 (Fri, 21 Mar 2008) | 1 line Replace hack in regrtest.py with use of sys.py3kwarning. ........ r61721 | georg.brandl | 2008-03-21 22:05:03 +0100 (Fri, 21 Mar 2008) | 2 lines Add missing versionadded tag. ........ r61722 | christian.heimes | 2008-03-22 00:49:44 +0100 (Sat, 22 Mar 2008) | 3 lines Applied patch #1657 epoll and kqueue wrappers for the select module The patch adds wrappers for the Linux epoll syscalls and the BSD kqueue syscalls. Thanks to Thomas Herve and the Twisted people for their support and help. TODO: Finish documentation documentation ........
1 parent 73a22f0 commit 4fbc72b

23 files changed

Lines changed: 2280 additions & 177 deletions

Doc/ACKS.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ [email protected]), and we'll be glad to correct the problem.
2121
* Chris Barker
2222
* Don Bashford
2323
* Anthony Baxter
24+
* Alexander Belopolsky
2425
* Bennett Benson
2526
* Jonathan Black
2627
* Robin Boerdijk

Doc/c-api/import.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,19 @@ Importing Modules
134134
``sys.modules``). Note that this is a per-interpreter variable.
135135

136136

137+
.. cfunction:: PyObject* PyImport_GetImporter(PyObject *path)
138+
139+
Return an importer object for a :data:`sys.path`/:attr:`pkg.__path__` item
140+
*path*, possibly by fetching it from the :data:`sys.path_importer_cache`
141+
dict. If it wasn't yet cached, traverse :data:`sys.path_hooks` until a hook
142+
is found that can handle the path item. Return ``None`` if no hook could;
143+
this tells our caller it should fall back to the builtin import mechanism.
144+
Cache the result in :data:`sys.path_importer_cache`. Return a new reference
145+
to the importer object.
146+
147+
.. versionadded:: 2.6
148+
149+
137150
.. cfunction:: void _PyImport_Init()
138151

139152
Initialize the import mechanism. For internal use only.

Doc/library/__future__.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
:mod:`__future__` --- Future statement definitions
32
==================================================
43

@@ -22,8 +21,8 @@
2221

2322
Each statement in :file:`__future__.py` is of the form::
2423

25-
FeatureName = "_Feature(" OptionalRelease "," MandatoryRelease ","
26-
CompilerFlag ")"
24+
FeatureName = _Feature(OptionalRelease, MandatoryRelease,
25+
CompilerFlag)
2726

2827

2928
where, normally, *OptionalRelease* is less than *MandatoryRelease*, and both are

Doc/library/future_builtins.rst

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
:mod:`future_builtins` --- Python 3 builtins
2+
============================================
3+
4+
.. module:: future_builtins
5+
.. sectionauthor:: Georg Brandl
6+
.. versionadded:: 2.6
7+
8+
This module provides functions that exist in 2.x, but have different behavior in
9+
Python 3, so they cannot be put into the 2.x builtin namespace.
10+
11+
Instead, if you want to write code compatible with Python 3 builtins, import
12+
them from this module, like this::
13+
14+
from future_builtins import map, filter
15+
16+
... code using Python 3-style map and filter ...
17+
18+
The :program:`2to3` tool that ports Python 2 code to Python 3 will recognize
19+
this usage and leave the new builtins alone.
20+
21+
.. note::
22+
23+
The Python 3 :func:`print` function is already in the builtins, but cannot be
24+
accessed from Python 2 code unless you use the appropriate future statement::
25+
26+
from __future__ import print_function
27+
28+
29+
Available builtins are:
30+
31+
.. function:: filter(function, iterable)
32+
33+
Works like :func:`itertools.ifilter`.
34+
35+
.. function:: hex(object)
36+
37+
Works like the builtin :func:`hex`, but instead of :meth:`__hex__` it will
38+
use the :meth:`__index__` method on its argument to get an integer that is
39+
then converted to hexadecimal.
40+
41+
.. function:: map(function, iterable, ...)
42+
43+
Works like :func:`itertools.imap`.
44+
45+
.. function:: oct(object)
46+
47+
Works like the builtin :func:`oct`, but instead of :meth:`__oct__` it will
48+
use the :meth:`__index__` method on its argument to get an integer that is
49+
then converted to hexadecimal.
50+
51+
.. function:: zip(*iterables)
52+
53+
Works like :func:`itertools.izip`.

Doc/library/python.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ overview:
1414

1515
sys.rst
1616
builtins.rst
17+
future_builtins.rst
1718
__main__.rst
1819
warnings.rst
1920
contextlib.rst

0 commit comments

Comments
 (0)