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

Skip to content

Commit 9bc9351

Browse files
committed
Merged revisions 66508,66510,66512-66513,66523-66526,66529-66530,66532,66535,66538,66544,66546 via svnmerge from
svn+ssh://[email protected]/python/trunk ........ r66508 | benjamin.peterson | 2008-09-18 18:20:28 -0500 (Thu, 18 Sep 2008) | 1 line tabify ........ r66510 | josiah.carlson | 2008-09-18 21:07:22 -0500 (Thu, 18 Sep 2008) | 2 lines Fix for documentation bug. Fixes issue 3904. ........ r66512 | raymond.hettinger | 2008-09-19 03:07:48 -0500 (Fri, 19 Sep 2008) | 1 line Improve docs for super(). ........ r66513 | lars.gustaebel | 2008-09-19 07:39:23 -0500 (Fri, 19 Sep 2008) | 2 lines Correct information about the tarfile module. ........ r66523 | georg.brandl | 2008-09-21 02:14:44 -0500 (Sun, 21 Sep 2008) | 2 lines #3852: fix some select.kqueue and kevent docs. ........ r66524 | georg.brandl | 2008-09-21 02:15:59 -0500 (Sun, 21 Sep 2008) | 2 lines #3912: document default for *places* arg. ........ r66525 | georg.brandl | 2008-09-21 02:17:00 -0500 (Sun, 21 Sep 2008) | 2 lines #3916: fixes for docs wrt. Windows directory layout ........ r66526 | georg.brandl | 2008-09-21 02:18:28 -0500 (Sun, 21 Sep 2008) | 2 lines #3914: add //= to the augmented assign operators. ........ r66529 | georg.brandl | 2008-09-21 02:24:11 -0500 (Sun, 21 Sep 2008) | 2 lines #3901: bsddb fix. ........ r66530 | georg.brandl | 2008-09-21 02:31:52 -0500 (Sun, 21 Sep 2008) | 2 lines #3897: _collections now has an underscore. ........ r66532 | georg.brandl | 2008-09-21 02:36:22 -0500 (Sun, 21 Sep 2008) | 2 lines Update readme and Makefile (web builder doesn't exist). ........ r66535 | georg.brandl | 2008-09-21 03:03:21 -0500 (Sun, 21 Sep 2008) | 2 lines #3918: note that uniform() args can be swapped. ........ r66538 | georg.brandl | 2008-09-21 05:03:39 -0500 (Sun, 21 Sep 2008) | 2 lines Add "dist" target. ........ r66544 | benjamin.peterson | 2008-09-21 16:27:51 -0500 (Sun, 21 Sep 2008) | 4 lines #3879 fix a regression in urllib.getproxies_environment reviewers: Benjamin, Georg ........ r66546 | georg.brandl | 2008-09-21 17:31:59 -0500 (Sun, 21 Sep 2008) | 2 lines Fill out download page. ........
1 parent 81817ad commit 9bc9351

17 files changed

Lines changed: 144 additions & 67 deletions

File tree

Doc/Makefile

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,23 @@ SVNROOT = http://svn.python.org/projects
99
SPHINXOPTS =
1010
PAPER =
1111
SOURCES =
12+
DISTVERSION =
1213

1314
ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_paper_size=$(PAPER) \
1415
$(SPHINXOPTS) . build/$(BUILDER) $(SOURCES)
1516

16-
.PHONY: help checkout update build html web htmlhelp clean coverage
17+
.PHONY: help checkout update build html htmlhelp clean coverage dist
1718

1819
help:
1920
@echo "Please use \`make <target>' where <target> is one of"
2021
@echo " html to make standalone HTML files"
21-
@echo " web to make file usable by Sphinx.web"
2222
@echo " htmlhelp to make HTML files and a HTML help project"
2323
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
2424
@echo " text to make plain text files"
2525
@echo " changes to make an overview over all changed/added/deprecated items"
2626
@echo " linkcheck to check all external links for integrity"
2727
@echo " coverage to check documentation coverage for library and C API"
28+
@echo " dist to create a \"dist\" directory with archived docs for download"
2829

2930
checkout:
3031
@if [ ! -d tools/sphinx ]; then \
@@ -59,12 +60,6 @@ html: BUILDER = html
5960
html: build
6061
@echo "Build finished. The HTML pages are in build/html."
6162

62-
web: BUILDER = web
63-
web: build
64-
@echo "Build finished; now you can run"
65-
@echo " PYTHONPATH=tools $(PYTHON) -m sphinx.web build/web"
66-
@echo "to start the server."
67-
6863
htmlhelp: BUILDER = htmlhelp
6964
htmlhelp: build
7065
@echo "Build finished; now you can run HTML Help Workshop with the" \
@@ -105,6 +100,44 @@ pydoc-topics: build
105100

106101
htmlview: html
107102
$(PYTHON) -c "import webbrowser; webbrowser.open('build/html/index.html')"
103+
108104
clean:
109105
-rm -rf build/*
110106
-rm -rf tools/sphinx
107+
108+
dist:
109+
-rm -rf dist
110+
mkdir -p dist
111+
112+
# archive the HTML
113+
make html
114+
cp -a build/html dist/python$(DISTVERSION)-docs-html
115+
tar -C dist -cf dist/python$(DISTVERSION)-docs-html.tar python$(DISTVERSION)-docs-html
116+
bzip2 -9 -k dist/python$(DISTVERSION)-docs-html.tar
117+
(cd dist; zip -q -r -9 python$(DISTVERSION)-docs-html.zip python$(DISTVERSION)-docs-html)
118+
rm -r dist/python$(DISTVERSION)-docs-html
119+
rm dist/python$(DISTVERSION)-docs-html.tar
120+
121+
# archive the text build
122+
make text
123+
cp -a build/text dist/python$(DISTVERSION)-docs-text
124+
tar -C dist -cf dist/python$(DISTVERSION)-docs-text.tar python$(DISTVERSION)-docs-text
125+
bzip2 -9 -k dist/python$(DISTVERSION)-docs-text.tar
126+
(cd dist; zip -q -r -9 python$(DISTVERSION)-docs-text.zip python$(DISTVERSION)-docs-text)
127+
rm -r dist/python$(DISTVERSION)-docs-text
128+
rm dist/python$(DISTVERSION)-docs-text.tar
129+
130+
# archive the A4 latex
131+
-rm -r build/latex
132+
make latex PAPER=a4
133+
(cd build/latex; make clean && make all-pdf && make FMT=pdf zip bz2)
134+
cp build/latex/docs-pdf.zip dist/python$(DISTVERSION)-docs-pdf-a4.zip
135+
cp build/latex/docs-pdf.tar.bz2 dist/python$(DISTVERSION)-docs-pdf-a4.tar.bz2
136+
137+
# archive the letter latex
138+
rm -r build/latex
139+
make latex PAPER=letter
140+
(cd build/latex; make clean && make all-pdf && make FMT=pdf zip bz2)
141+
cp build/latex/docs-pdf.zip dist/python$(DISTVERSION)-docs-pdf-letter.zip
142+
cp build/latex/docs-pdf.tar.bz2 dist/python$(DISTVERSION)-docs-pdf-letter.tar.bz2
143+

Doc/README.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ Available make targets are:
4343

4444
* "html", which builds standalone HTML files for offline viewing.
4545

46-
* "web", which builds files usable with the Sphinx.web application (used to
47-
serve the docs online at http://docs.python.org/).
48-
4946
* "htmlhelp", which builds HTML files and a HTML Help project file usable to
5047
convert them into a single Compiled HTML (.chm) file -- these are popular
5148
under Microsoft Windows, but very handy on every platform.

Doc/library/asynchat.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,8 @@ any extraneous data sent by the web client are ignored. ::
278278

279279
class http_request_handler(asynchat.async_chat):
280280

281-
def __init__(self, conn, addr, sessions, log):
282-
asynchat.async_chat.__init__(self, conn=conn)
281+
def __init__(self, sock, addr, sessions, log):
282+
asynchat.async_chat.__init__(self, sock=sock)
283283
self.addr = addr
284284
self.sessions = sessions
285285
self.ibuffer = []

Doc/library/functions.rst

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,23 +1086,38 @@ are always available. They are listed here in alphabetical order.
10861086

10871087
.. XXX updated as per http://www.artima.com/weblogs/viewpost.jsp?thread=208549 but needs checking
10881088
1089+
Return a "super" object that acts like the superclass of *type*.
10891090

1090-
Return a "super" object that acts like the superclass of *type*. If the
1091-
second argument is omitted the super object returned is unbound. If the
1092-
second argument is an object, ``isinstance(obj, type)`` must be true. If the
1093-
second argument is a type, ``issubclass(type2, type)`` must be
1094-
true. :func:`super` only works for :term:`new-style class`\es. Calling
1095-
:func:`super()` without arguments is equivalent to ``super(this_class,
1091+
If the second argument is omitted the super object returned is unbound. If
1092+
the second argument is an object, ``isinstance(obj, type)`` must be true. If
1093+
the second argument is a type, ``issubclass(type2, type)`` must be true.
1094+
Calling :func:`super` without arguments is equivalent to ``super(this_class,
10961095
first_arg)``.
10971096

1098-
A typical use for calling a cooperative superclass method is::
1097+
There are two typical use cases for "super". In a class hierarchy with
1098+
single inheritance, "super" can be used to refer to parent classes without
1099+
naming them explicitly, thus making the code more maintainable. This use
1100+
closely parallels the use of "super" in other programming languages.
1101+
1102+
The second use case is to support cooperative multiple inheritence in a
1103+
dynamic execution environment. This use case is unique to Python and is
1104+
not found in statically compiled languages or languages that only support
1105+
single inheritance. This makes in possible to implement "diamond diagrams"
1106+
where multiple base classes implement the same method. Good design dictates
1107+
that this method have the same calling signature in every case (because the
1108+
order of parent calls is determined at runtime and because that order adapts
1109+
to changes in the class hierarchy).
1110+
1111+
For both use cases, a typical superclass call looks like this::
10991112

11001113
class C(B):
11011114
def method(self, arg):
11021115
super().method(arg) # This does the same thing as: super(C, self).method(arg)
11031116

11041117
Note that :func:`super` is implemented as part of the binding process for
11051118
explicit dotted attribute lookups such as ``super().__getitem__(name)``.
1119+
It does so by implementing its own :meth:`__getattribute__` method for searching
1120+
parent classes in a predictable order that supports cooperative multiple inheritance.
11061121
Accordingly, :func:`super` is undefined for implicit lookups using statements or
11071122
operators such as ``super()[name]``. Also, :func:`super` is not
11081123
limited to use inside methods: under the hood it searches the stack

Doc/library/random.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ be found in any statistics text.
149149

150150
.. function:: uniform(a, b)
151151

152-
Return a random floating point number *N* such that ``a <= N < b``.
152+
Return a random floating point number *N* such that ``a <= N < b`` for
153+
``a <= b`` and ``b <= N < a`` for ``b < a``.
153154

154155

155156
.. function:: triangular(low, high, mode)

Doc/library/select.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ The module defines the following:
4646
:ref:`kqueue-objects` below for the methods supported by kqueue objects.
4747

4848

49-
.. function:: kqueue(ident, filter=KQ_FILTER_READ, flags=KQ_ADD, fflags=0, data=0, udata=0)
49+
.. function:: kevent(ident, filter=KQ_FILTER_READ, flags=KQ_ADD, fflags=0, data=0, udata=0)
5050

5151
(Only supported on BSD.) Returns a kernel event object object; see section
5252
:ref:`kevent-objects` below for the methods supported by kqueue objects.
@@ -264,12 +264,12 @@ Kqueue Objects
264264
Return the file descriptor number of the control fd.
265265

266266

267-
.. method:: epoll.fromfd(fd)
267+
.. method:: kqueue.fromfd(fd)
268268

269269
Create a kqueue object from a given file descriptor.
270270

271271

272-
.. method:: control(changelist, max_events=0[, timeout=None]) -> eventlist
272+
.. method:: kqueue.control(changelist, max_events[, timeout=None]) -> eventlist
273273

274274
Low level interface to kevent
275275

Doc/library/unittest.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,8 @@ failures.
591591
TestCase.failUnlessAlmostEqual(first, second[, places[, msg]])
592592

593593
Test that *first* and *second* are approximately equal by computing the
594-
difference, rounding to the given number of *places*, and comparing to zero.
594+
difference, rounding to the given number of decimal *places* (default 7),
595+
and comparing to zero.
595596
Note that comparing a given number of decimal places is not the same as
596597
comparing a given number of significant digits. If the values do not compare
597598
equal, the test will fail with the explanation given by *msg*, or :const:`None`.
@@ -601,7 +602,8 @@ failures.
601602
TestCase.failIfAlmostEqual(first, second[, places[, msg]])
602603

603604
Test that *first* and *second* are not approximately equal by computing the
604-
difference, rounding to the given number of *places*, and comparing to zero.
605+
difference, rounding to the given number of decimal *places* (default 7),
606+
and comparing to zero.
605607
Note that comparing a given number of decimal places is not the same as
606608
comparing a given number of significant digits. If the values do not compare
607609
equal, the test will fail with the explanation given by *msg*, or :const:`None`.

Doc/reference/simple_stmts.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ operation and an assignment statement:
247247

248248
.. productionlist::
249249
augmented_assignment_stmt: `target` `augop` (`expression_list` | `yield_expression`)
250-
augop: "+=" | "-=" | "*=" | "/=" | "%=" | "**="
250+
augop: "+=" | "-=" | "*=" | "/=" | "//=" | "%=" | "**="
251251
: | ">>=" | "<<=" | "&=" | "^=" | "|="
252252
253253
(See section :ref:`primaries` for the syntax definitions for the last three

Doc/tools/sphinxext/download.html

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,37 @@
11
{% extends "layout.html" %}
22
{% set title = 'Download' %}
3+
{% set dlbase = 'http://docs.python.org/ftp/python/doc/' + release %}
34
{% block body %}
45

56
<h1>Download Python {{ release }} Documentation
67
{%- if last_updated %} (last updated on {{ last_updated }}){% endif %}</h1>
78

8-
<p>Currently, the development documentation isn't packaged for download.</p>
9-
10-
<!--
119
<p>To download an archive containing all the documents for this version of
1210
Python in one of various formats, follow one of links in this table. The numbers
1311
in the table are the size of the download files in Kilobytes.</p>
1412

15-
{# XXX download links #}
16-
17-
18-
<p>These archives contain all the content in the documentation section.</p>
13+
<table class="docutils">
14+
<tr><th>Format</th><th>Packed as .zip</th><th>Packed as .tar.bz2</th></tr>
15+
<tr><td>PDF (US-Letter paper size)</td>
16+
<td><a href="{{ dlbase }}/python-docs-pdf-letter.zip">Download</a> (ca. 8 MB)</td>
17+
<td><a href="{{ dlbase }}/python-docs-pdf-letter.tar.bz2">Download</a> (ca. 8 MB)</td>
18+
</tr>
19+
<tr><td>PDF (A4 paper size)</td>
20+
<td><a href="{{ dlbase }}/python-docs-pdf-a4.zip">Download</a> (ca. 8 MB)</td>
21+
<td><a href="{{ dlbase }}/python-docs-pdf-a4.tar.bz2">Download</a> (ca. 8 MB)</td>
22+
</tr>
23+
<tr><td>HTML</td>
24+
<td><a href="{{ dlbase }}/python-docs-html.zip">Download</a> (ca. 6 MB)</td>
25+
<td><a href="{{ dlbase }}/python-docs-html.tar.bz2">Download</a> (ca. 4 MB)</td>
26+
</tr>
27+
<tr><td>Plain Text</td>
28+
<td><a href="{{ dlbase }}/python-docs-pdf-text.zip">Download</a> (ca. 2 MB)</td>
29+
<td><a href="{{ dlbase }}/python-docs-pdf-text.tar.bz2">Download</a> (ca. 1.5 MB)</td>
30+
</tr>
31+
</table>
32+
33+
34+
<p>These archives contain all the content in the documentation.</p>
1935

2036
<h2>Unpacking</h2>
2137

@@ -26,22 +42,12 @@ <h2>Unpacking</h2>
2642
best compression and fastest download times.</p>
2743

2844
<p>Windows users can use the ZIP archives since those are customary on that
29-
platform. These are created on Unix using the InfoZIP zip program. They may be
30-
unpacked using the free WiZ tool (from the InfoZIP developers) or any other
31-
tool for handling ZIP archives; any of them should work.</p>
32-
33-
<p>Note that the .tar.bz2 files are smaller than the other archives; Windows
34-
users may want to install the bzip2 tools on their systems as well. Windows
35-
binaries for a command-line tool are available at <a
36-
href="http://www.bzip.org">The bzip2 and libbzip2 official home page</a>, but
37-
most other archiving utilities support the tar and bzip2 formats as well.</p>
45+
platform. These are created on Unix using the InfoZIP zip program.</p>
3846

3947

4048
<h2>Problems</h2>
4149

4250
<p>If you have comments or suggestions for the Python documentation, please send
4351
email to <a href="[email protected]">[email protected]</a>.</p>
4452

45-
-->
46-
4753
{% endblock %}

Doc/using/windows.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ directory of your Python distribution, delimited by a semicolon from other
140140
entries. An example variable could look like this (assuming the first two
141141
entries are Windows' default)::
142142

143-
C:\WINNT\system32;C:\WINNT;C:\Python25
143+
C:\WINDOWS\system32;C:\WINDOWS;C:\Python25
144144

145145
Typing :command:`python` on your command prompt will now fire up the Python
146146
interpreter. Thus, you can also execute your scripts with command line options,
@@ -276,11 +276,11 @@ releases are built, the source tree contains solutions/project files. View the
276276
+====================+==============+=======================+
277277
| :file:`PC/VC6/` | 6.0 | 97 |
278278
+--------------------+--------------+-----------------------+
279-
| :file:`PCbuild/` | 7.1 | 2003 |
279+
| :file:`PC/VS7.1/` | 7.1 | 2003 |
280280
+--------------------+--------------+-----------------------+
281-
| :file:`PCbuild8/` | 8.0 | 2005 |
281+
| :file:`PC/VS8.0/` | 8.0 | 2005 |
282282
+--------------------+--------------+-----------------------+
283-
| :file:`PCbuild9/` | 9.0 | 2008 |
283+
| :file:`PCbuild/` | 9.0 | 2008 |
284284
+--------------------+--------------+-----------------------+
285285

286286
Note that not all of these build directories are fully supported. Read the

0 commit comments

Comments
 (0)