Skip to content

Commit 4e86bf2

Browse files
committed
merge 3.3 (#20901)
2 parents 2c3e261 + ad36fe9 commit 4e86bf2

1,470 files changed

Lines changed: 167184 additions & 108004 deletions

File tree

Some content is hidden

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

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ Doc/tools/jinja2/
1515
Doc/tools/pygments/
1616
Doc/tools/sphinx/
1717
Lib/lib2to3/*.pickle
18+
Lib/test/data/*
1819
Lib/_sysconfigdata.py
1920
Lib/plat-mac/errors.rsrc.df.rsrc
2021
Makefile
2122
Makefile.pre
2223
Misc/python.pc
24+
Misc/python-config.sh
2325
Modules/Setup
2426
Modules/Setup.config
2527
Modules/Setup.local
@@ -57,6 +59,8 @@ platform
5759
pybuilddir.txt
5860
pyconfig.h
5961
python
62+
python-config
63+
python-config.py
6064
python.exe
6165
python-gdb.py
6266
python.exe-gdb.py

.hgeol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
**.psd = BIN
2727
**.tar = BIN
2828
**.wav = BIN
29+
**.whl = BIN
2930
**.xar = BIN
3031
**.zip = BIN
3132

.hgignore

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,20 @@ platform$
1919
pyconfig.h$
2020
python$
2121
python.exe$
22+
python-config$
23+
python-config.py$
2224
reflog.txt$
2325
tags$
2426
Lib/plat-mac/errors.rsrc.df.rsrc
25-
Doc/tools/sphinx/
26-
Doc/tools/docutils/
27-
Doc/tools/jinja/
28-
Doc/tools/jinja2/
29-
Doc/tools/pygments/
3027
Misc/python.pc
28+
Misc/python-config.sh$
3129
Modules/Setup$
3230
Modules/Setup.config
3331
Modules/Setup.local
3432
Modules/config.c
3533
Modules/ld_so_aix$
3634
Parser/pgen$
35+
^lcov-report/
3736
^core
3837
^python-gdb.py
3938
^python.exe-gdb.py
@@ -82,10 +81,17 @@ PCbuild/*.*sdf
8281
PCbuild/Win32-temp-*
8382
PCbuild/x64-temp-*
8483
PCbuild/amd64
84+
PCbuild/ipch
85+
Tools/unicode/build/
86+
Tools/unicode/MAPPINGS/
8587
BuildLog.htm
8688
__pycache__
8789
Modules/_freeze_importlib
8890
Modules/_testembed
8991
.coverage
9092
coverage/
9193
htmlcov/
94+
*.gcda
95+
*.gcno
96+
*.gcov
97+
coverage.info

.hgtouch

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
Python/importlib.h: Lib/importlib/_bootstrap.py Modules/_freeze_importlib.c
66

7-
Include/ast.h: Parser/Python.asdl Parser/asdl.py Parser/asdl_c.py
8-
Include/Python-ast.h: Include/ast.h
7+
Include/Python-ast.h: Parser/Python.asdl Parser/asdl.py Parser/asdl_c.py
98
Python/Python-ast.c: Include/Python-ast.h
109

1110
Python/opcode_targets.h: Python/makeopcodetargets.py Lib/opcode.py

Doc/Makefile

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# You can set these variables from the command line.
77
PYTHON = python
8-
SVNROOT = http://svn.python.org/projects
8+
SPHINXBUILD = sphinx-build
99
SPHINXOPTS =
1010
PAPER =
1111
SOURCES =
@@ -21,7 +21,6 @@ ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_paper_size=$(PAPER) \
2121
help:
2222
@echo "Please use \`make <target>' where <target> is one of"
2323
@echo " clean to remove build files"
24-
@echo " update to update build tools"
2524
@echo " html to make standalone HTML files"
2625
@echo " htmlhelp to make HTML files and a HTML help project"
2726
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@@ -37,30 +36,8 @@ help:
3736
@echo " check to run a check for frequent markup errors"
3837
@echo " serve to serve the documentation on the localhost (8000)"
3938

40-
# Note: if you update versions here, do the same in make.bat and README.txt
41-
checkout:
42-
@if [ ! -d tools/sphinx ]; then \
43-
echo "Checking out Sphinx..."; \
44-
svn checkout $(SVNROOT)/external/Sphinx-1.2/sphinx tools/sphinx; \
45-
fi
46-
@if [ ! -d tools/docutils ]; then \
47-
echo "Checking out Docutils..."; \
48-
svn checkout $(SVNROOT)/external/docutils-0.11/docutils tools/docutils; \
49-
fi
50-
@if [ ! -d tools/jinja2 ]; then \
51-
echo "Checking out Jinja..."; \
52-
svn checkout $(SVNROOT)/external/Jinja-2.3.1/jinja2 tools/jinja2; \
53-
fi
54-
@if [ ! -d tools/pygments ]; then \
55-
echo "Checking out Pygments..."; \
56-
svn checkout $(SVNROOT)/external/Pygments-1.6/pygments tools/pygments; \
57-
fi
58-
59-
update: clean checkout
60-
6139
build: checkout
62-
mkdir -p build/$(BUILDER) build/doctrees
63-
$(PYTHON) tools/sphinx-build.py $(ALLSPHINXOPTS)
40+
$(SPHINXBUILD) $(ALLSPHINXOPTS)
6441
@echo
6542

6643
html: BUILDER = html
@@ -120,10 +97,6 @@ htmlview: html
12097

12198
clean:
12299
-rm -rf build/*
123-
-rm -rf tools/sphinx
124-
-rm -rf tools/pygments
125-
-rm -rf tools/jinja2
126-
-rm -rf tools/docutils
127100

128101
dist:
129102
rm -rf dist

Doc/README.txt

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,31 @@ Python Documentation README
33

44
This directory contains the reStructuredText (reST) sources to the Python
55
documentation. You don't need to build them yourself, prebuilt versions are
6-
available at http://docs.python.org/download/.
6+
available at <http://docs.python.org/download/>.
77

88
Documentation on the authoring Python documentation, including information about
99
both style and markup, is available in the "Documenting Python" chapter of the
10-
documentation.
10+
developers guide <http://docs.python.org/devguide/documenting.html>.
1111

1212

1313
Building the docs
1414
=================
1515

16-
You need to have Python 2 installed; the toolset used to build the
17-
docs is written in Python. It is called *Sphinx*, it is not included in this
18-
tree, but maintained separately. Also needed are the docutils, supplying the
19-
base markup that Sphinx uses, Jinja, a templating engine, and optionally
20-
Pygments, a code highlighter.
16+
You need to have Sphinx <http://sphinx-doc.org/> installed; it is the toolset
17+
used to build the docs. It is not included in this tree, but maintained
18+
separately and available from PyPI <http://pypi.python.org/pypi/Sphinx>.
2119

2220

2321
Using make
2422
----------
2523

26-
Luckily, a Makefile has been prepared so that on Unix, provided you have
27-
installed Python and Subversion, you can just run ::
24+
A Makefile has been prepared so that on Unix, provided you have installed
25+
Sphinx, you can just run ::
2826

2927
make html
3028

31-
to check out the necessary toolset in the `tools/` subdirectory and build the
32-
HTML output files. To view the generated HTML, point your favorite browser at
33-
the top-level index `build/html/index.html` after running "make".
29+
to build the HTML output files. To view the generated HTML, point your favorite
30+
browser at the top-level index `build/html/index.html` after running "make".
3431

3532
On Windows, we try to emulate the Makefile as closely as possible with a
3633
``make.bat`` file.
@@ -78,8 +75,6 @@ Available make targets are:
7875
* "suspicious", which checks the parsed markup for text that looks like
7976
malformed and thus unconverted reST.
8077

81-
A "make update" updates the Subversion checkouts in `tools/`.
82-
8378

8479
Without make
8580
------------

Doc/c-api/arg.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@ Other objects
295295
the object pointer is stored. If the Python object does not have the required
296296
type, :exc:`TypeError` is raised.
297297

298+
.. _o_ampersand:
299+
298300
``O&`` (object) [*converter*, *anything*]
299301
Convert a Python object to a C variable through a *converter* function. This
300302
takes two arguments: the first is a function, the second is the address of a C

Doc/c-api/concrete.rst

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,26 +74,35 @@ intrinsic to the Python language.
7474

7575
.. _mapobjects:
7676

77-
Mapping Objects
78-
===============
77+
Container Objects
78+
=================
7979

8080
.. index:: object: mapping
8181

8282
.. toctree::
8383

8484
dict.rst
85+
set.rst
8586

8687

8788
.. _otherobjects:
8889

89-
Other Objects
90-
=============
90+
Function Objects
91+
================
9192

9293
.. toctree::
9394

94-
set.rst
9595
function.rst
9696
method.rst
97+
cell.rst
98+
code.rst
99+
100+
101+
Other Objects
102+
=============
103+
104+
.. toctree::
105+
97106
file.rst
98107
module.rst
99108
iterator.rst
@@ -102,7 +111,6 @@ Other Objects
102111
memoryview.rst
103112
weakref.rst
104113
capsule.rst
105-
cell.rst
106114
gen.rst
107115
datetime.rst
108-
code.rst
116+

Doc/c-api/dict.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Dictionary Objects
8484
on failure.
8585
8686
87-
.. c:function:: int PyDict_DelItemString(PyObject *p, char *key)
87+
.. c:function:: int PyDict_DelItemString(PyObject *p, const char *key)
8888
8989
Remove the entry in dictionary *p* which has a key specified by the string
9090
*key*. Return ``0`` on success or ``-1`` on failure.
@@ -110,6 +110,15 @@ Dictionary Objects
110110
:c:type:`char\*`, rather than a :c:type:`PyObject\*`.
111111
112112
113+
.. c:function:: PyObject* PyDict_SetDefault(PyObject *p, PyObject *key, PyObject *default)
114+
115+
This is the same as the Python-level :meth:`dict.setdefault`. If present, it
116+
returns the value corresponding to *key* from the dictionary *p*. If the key
117+
is not in the dict, it is inserted with value *defaultobj* and *defaultobj*
118+
is returned. This function evaluates the hash function of *key* only once,
119+
instead of evaluating it independently for the lookup and the insertion.
120+
121+
113122
.. c:function:: PyObject* PyDict_Items(PyObject *p)
114123
115124
Return a :c:type:`PyListObject` containing all the items from the dictionary.

0 commit comments

Comments
 (0)