8000 Merged revisions 75365,75394,75402-75403,75418,75459,75484,75592-7559… · python/cpython@495f7b5 · GitHub 10000
[go: up one dir, main page]

Skip to content

Commit 495f7b5

Browse files
committed
Merged revisions 75365,75394,75402-75403,75418,75459,75484,75592-75596,75600,75602-75607,75610-75613,75616-75617,75623,75627,75640,75647,75696,75795 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r75365 | georg.brandl | 2009-10-11 22:16:16 +0200 (So, 11 Okt 2009) | 1 line Fix broken links found by "make linkcheck". scipy.org seems to be done right now, so I could not verify links going there. ........ r75394 | georg.brandl | 2009-10-13 20:10:59 +0200 (Di, 13 Okt 2009) | 1 line Fix markup. ........ r75402 | georg.brandl | 2009-10-14 17:51:48 +0200 (Mi, 14 Okt 2009) | 1 line #7125: fix typo. ........ r75403 | georg.brandl | 2009-10-14 17:57:46 +0200 (Mi, 14 Okt 2009) | 1 line #7126: os.environ changes *do* take effect in subprocesses started with os.system(). ........ r75418 | georg.brandl | 2009-10-14 20:48:32 +0200 (Mi, 14 Okt 2009) | 1 line #7116: str.join() takes an iterable. ........ r75459 | georg.brandl | 2009-10-17 10:57:43 +0200 (Sa, 17 Okt 2009) | 1 line Fix refleaks in _ctypes PyCSimpleType_New, which fixes the refleak seen in test___all__. ........ r75484 | georg.brandl | 2009-10-18 09:58:12 +0200 (So, 18 Okt 2009) | 1 line Fix missing word. ........ r75592 | georg.brandl | 2009-10-22 09:05:48 +0200 (Do, 22 Okt 2009) | 1 line Fix punctuation. ........ r75593 | georg.brandl | 2009-10-22 09:06:49 +0200 (Do, 22 Okt 2009) | 1 line Revert unintended change. ........ r75594 | georg.brandl | 2009-10-22 09:56:02 +0200 (Do, 22 Okt 2009) | 1 line Fix markup. ........ r75595 | georg.brandl | 2009-10-22 09:56:56 +0200 (Do, 22 Okt 2009) | 1 line Fix duplicate target. ........ r75596 | georg.brandl | 2009-10-22 10:05:04 +0200 (Do, 22 Okt 2009) | 1 line Add a new directive marking up implementation details and start using it. ........ r75600 | georg.brandl | 2009-10-22 13:01:46 +0200 (Do, 22 Okt 2009) | 1 line Make it more robust. ........ r75602 | georg.brandl | 2009-10-22 13:28:06 +0200 (Do, 22 Okt 2009) | 1 line Document new directive. ........ r75603 | georg.brandl | 2009-10-22 13:28:23 +0200 (Do, 22 Okt 2009) | 1 line Allow short form with text as argument. ........ r75604 | georg.brandl | 2009-10-22 13:36:50 +0200 (Do, 22 Okt 2009) | 1 line Fix stylesheet for multi-paragraph impl-details. ........ r75605 | georg.brandl | 2009-10-22 13:48:10 +0200 (Do, 22 Okt 2009) | 1 line Use "impl-detail" directive where applicable. ........ r75606 | georg.brandl | 2009-10-22 17:00:06 +0200 (Do, 22 Okt 2009) | 1 line #6324: membership test tries iteration via __iter__. ........ r75607 | georg.brandl | 2009-10-22 17:04:09 +0200 (Do, 22 Okt 2009) | 1 line #7088: document new functions in signal as Unix-only. ........ r75610 | georg.brandl | 2009-10-22 17:27:24 +0200 (Do, 22 Okt 2009) | 1 line Reorder __slots__ fine print and add a clarification. ........ r75611 | georg.brandl | 2009-10-22 17:42:32 +0200 (Do, 22 Okt 2009) | 1 line #7035: improve docs of the various <method>_errors() functions, and give them docstrings. ........ r75612 | georg.brandl | 2009-10-22 17:52:15 +0200 (Do, 22 Okt 2009) | 1 line #7156: document curses as Unix-only. ........ r75613 | georg.brandl | 2009-10-22 17:54:35 +0200 (Do, 22 Okt 2009) | 1 line #6977: getopt does not support optional option arguments. ........ r75616 | georg.brandl | 2009-10-22 18:17:05 +0200 (Do, 22 Okt 2009) | 1 line Add proper references. ........ r75617 | georg.brandl | 2009-10-22 18:20:55 +0200 (Do, 22 Okt 2009) | 1 line Make printout margin important. ........ r75623 | georg.brandl | 2009-10-23 10:14:44 +0200 (Fr, 23 Okt 2009) | 1 line 10BC0 #7188: fix optionxform() docs. ........ r75627 | fred.drake | 2009-10-23 15:04:51 +0200 (Fr, 23 Okt 2009) | 2 lines add further note about what's passed to optionxform ........ r75640 | neil.schemenauer | 2009-10-23 21:58:17 +0200 (Fr, 23 Okt 2009) | 2 lines Improve some docstrings in the 'warnings' module. ........ r75647 | georg.brandl | 2009-10-24 12:04:19 +0200 (Sa, 24 Okt 2009) | 1 line Fix markup. ........ r75696 | georg.brandl | 2009-10-25 21:25:43 +0100 (So, 25 Okt 2009) | 1 line Fix a demo. ........ r75795 | georg.brandl | 2009-10-27 16:10:22 +0100 (Di, 27 Okt 2009) | 1 line Fix a strange mis-edit. ........
1 parent facabe2 commit 495f7b5

Some content is hidden

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

50 files changed

+370
-233
lines changed

Demo/comparisons/sortingtest.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,20 @@
2424
# - Handles blank input lines correctly
2525

2626
import re
27-
import string
2827
import sys
2928

3029
def main():
3130
prog = re.compile('^(.*)=([-+]?[0-9]+)')
3231
def makekey(item, prog=prog):
3332
match = prog.match(item)
3433
if match:
35-
var, num = match.group(1, 2)
36-
return string.atoi(num), var
34+
var, num = match.groups()
35+
return int(num), var
3736
else:
3837
# Bad input -- pretend it's a var with value 0
3938
return 0, item
40-
while 1:
41-
line = sys.stdin.readline()
42-
if not line:
43-
break
44-
items = line.split()
45-
items = list(map(makekey, items))
46-
items.sort()
39+
for line in sys.stdin:
40+
items = sorted(makekey(item) for item in line.split())
4741
for num, var in items:
4842
print("%s=%s" % (var, num), end=' ')
4943
print()

Doc/distutils/apiref.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1976,9 +1976,9 @@ it so that it's implementing the class :class:`peel_banana`, a subclass of
19761976
Subclasses of :class:`Command` must define the following methods.
19771977

19781978

1979-
.. method:: Command.initialize_options()(S)
1979+
.. method:: Command.initialize_options()
19801980

1981-
et default values for all the options that this command supports. Note that
1981+
Set default values for all the options that this command supports. Note that
19821982
these defaults may be overridden by other commands, by the setup script, by
19831983
config files, or by the command-line. Thus, this is not the place to code
19841984
dependencies between options; generally, :meth:`initialize_options`

Doc/documenting/markup.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,24 @@ units as well as normal text:
626626

627627
--------------
628628

629+
.. describe:: impl-detail
630+
631+
This directive is used to mark CPython-specific information. Use either with
632+
a block content or a single sentence as an argument, i.e. either ::
633+
634+
.. impl-detail::
635+
636+
This describes some implementation detail.
637+
638+
More explanation.
639+
640+
or ::
641+
642+
.. impl-detail:: This shortly mentions an implementation detail.
643+
644+
"\ **CPython implementation detail:**\ " is automatically prepended to the
645+
content.
646+
629647
.. describe:: seealso
630648

631649
Many sections include a list of references to module documentation or

Doc/faq/design.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -396,12 +396,13 @@ calls into the Python run-time system, even for seemingly simple operations like
396396
``x+1``.
397397

398398
Several projects described in the Python newsgroup or at past `Python
399-
conferences <http://python.org/community/workshops/>`_ have shown that this approach is feasible,
400-
although the speedups reached so far are only modest (e.g. 2x). Jython uses the
401-
same strategy for compiling to Java bytecode. (Jim Hugunin has demonstrated
402-
that in combination with whole-program analysis, speedups of 1000x are feasible
403-
for small demo programs. See the proceedings from the `1997 Python conference
404-
<http://python.org/community/workshops/1997-10/proceedings/>`_ for more information.)
399+
conferences <http://python.org/community/workshops/>`_ have shown that this
400+
approach is feasible, although the speedups reached so far are only modest
401+
(e.g. 2x). Jython uses the same strategy for compiling to Java bytecode. (Jim
402+
Hugunin has demonstrated that in combination with whole-program analysis,
403+
speedups of 1000x are feasible for small demo programs. See the proceedings
404+
from the `1997 Python conference
405+
<http://python.org/workshops/1997-10/proceedings/>`_ for more information.)
405406

406407
Internally, Python source code is always translated into a bytecode
407408
representation, and this bytecode is then executed by the Python virtual

Doc/faq/extending.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Python's C API.
4848
If you need to interface to some C or C++ library for which no Python extension
4949
currently exists, you can try wrapping the library's data types and functions
5050
with a tool such as `SWIG <http://www.swig.org>`_. `SIP
51-
<http://www.riverbankcomputing.co.uk/sip/>`_, `CXX
51+
<http://www.riverbankcomputing.co.uk/software/sip/>`__, `CXX
5252
<http://cxx.sourceforge.net/>`_ `Boost
5353
<http://www.boost.org/libs/python/doc/index.html>`_, or `Weave
5454
<http://www.scipy.org/site_content/weave>`_ are also alternatives for wrapping

Doc/faq/general.rst

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,10 @@ Sphinx-formatted documentation, Python library modules, example programs, and
164164
several useful pieces of freely distributable software. The source will compile
165165
and run out of the box on most UNIX platforms.
166166

167-
Consult the `Developer FAQ
168-
<http://www.python.org/dev/devfaq.html#subversion-svn>`__ for more information
169-
on getting the source code and compiling it.
167+
.. XXX update link once the dev faq is relocated
168+
169+
Consult the `Developer FAQ <http://www.python.org/dev/faq/>`__ for more
170+
information on getting the source code and compiling it.
170171

171172

172173
How do I get documentation on Python?
@@ -176,7 +177,7 @@ How do I get documentation on Python?
176177
177178
The standard documentation for the current stable version of Python is available
178179
at http://docs.python.org/. PDF, plain text, and downloadable HTML versions are
179-
also available at http://docs.python.org/download/.
180+
also available at http://docs.python.org/download.html.
180181

181182
The documentation is written in reStructuredText and processed by `the Sphinx
182183
documentation tool <http://sphinx.pocoo.org/>`__. The reStructuredText source
@@ -220,8 +221,10 @@ releases are announced on the comp.lang.python and comp.lang.python.announce
220221
newsgroups and on the Python home page at http://www.python.org/; an RSS feed of
221222
news is available.
222223

224+
.. XXX update link once the dev faq is relocated
225+
223226
You can also access the development version of Python through Subversion. See
224-
http://www.python.org/dev/devfaq.html#subversion-svn for details.
227+
http://www.python.org/dev/faq/ for details.
225228

226229

227230
How do I submit bug reports and patches for Python?

Doc/faq/gui.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ Qt
4545
'''
4646

4747
There are bindings available for the Qt toolkit (`PyQt
48-
<http://www.riverbankcomputing.co.uk/pyqt/>`_) and for KDE (PyKDE). If you're
49-
writing open source software, you don't need to pay for PyQt, but if you want to
50-
write proprietary applications, you must buy a PyQt license from `Riverbank
51-
Computing <http://www.riverbankcomputing.co.uk>`_ and a Qt license from
52-
`Trolltech <http://www.trolltech.com>`_.
48+
<http://www.riverbankcomputing.co.uk/software/pyqt/>`_) and for KDE (PyKDE). If
49+
you're writing open source software, you don't need to pay for PyQt, but if you
50+
want to write proprietary applications, you must buy a PyQt license from
51+
`Riverbank Computing <http://www.riverbankcomputing.co.uk>`_ and (up to Qt 4.4;
52+
Qt 4.5 upwards is licensed under the LGPL license) a Qt license from `Trolltech
53+
<http://www.trolltech.com>`_.
5354

5455
Gtk+
5556
''''

Doc/faq/library.rst

Lines changed: 10 additions & 14 deletions
F666
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,10 @@ Check :ref:`the Library Reference <library-index>` to see if there's a relevant
1616
standard library module. (Eventually you'll learn what's in the standard
1717
library and will able to skip this step.)
1818

19-
Search the `Python Package Index <http://pypi.python.org/pypi>`_.
20-
21-
Next, check the `Vaults of Parnassus <http://www.vex.net/parnassus/>`_, an older
22-
index of packages.
23-
24-
Finally, try `Google <http://www.google.com>`_ or other Web search engine.
25-
Searching for "Python" plus a keyword or two for your topic of interest will
26-
usually find something helpful.
19+
For third-party packages, search the `Python Package Index
20+
<http://pypi.python.org/pypi>`_ or try `Google <http://www.google.com>`_ or
21+
another Web search engine. Searching for "Python" plus a keyword or two for
22+
your topic of interest will usually find something helpful.
2723

2824

2925
Where is the math.py (socket.py, regex.py, etc.) source file?
@@ -181,11 +177,10 @@ in Python.
181177
How do I create documentation from doc strings?
182178
-----------------------------------------------
183179

184-
.. XXX mention Sphinx/epydoc
185-
186180
The :mod:`pydoc` module can create HTML from the doc strings in your Python
187-
source code. An alternative is `pythondoc
188-
<http://starship.python.net/crew/danilo/pythondoc/>`_.
181+
source code. An alternative for creating API documentation purely from
182+
docstrings is `epydoc <http://epydoc.sf.net/>`_. `Sphinx
183+
<http://sphinx.pocoo.org>`_ can also include docstring content.
189184

190185

191186
How do I get a single keypress at a time?
@@ -237,7 +232,7 @@ The :mod:`threading` module builds convenient abstractions on top of the
237232
low-level primitives provided by the :mod:`_thread` module.
238233

239234
Aahz has a set of slides from his threading tutorial that are helpful; see
240-
http://starship.python.net/crew/aahz/OSCON2001/.
235+
http://www.pythoncraft.com/OSCON2001/.
241236

242237

243238
None of my threads seem to run: why?
@@ -397,6 +392,7 @@ Can't we get rid of the Global Interpreter Lock?
397392
------------------------------------------------
398393

399394
.. XXX mention multiprocessing
395+
.. XXX link to dbeazley's talk about GIL?
400396
401397
The Global Interpreter Lock (GIL) is often seen as a hindrance to Python's
402398
deployment on high-end multiprocessor server machines, because a multi-threaded
@@ -583,7 +579,7 @@ substituted for standard input and output. You will have to use pseudo ttys
583579
("ptys") instead of pipes. Or you can use a Python interface to Don Libes'
584580
"expect" library. A Python extension that interfaces to expect is called "expy"
585581
and available from http://expectpy.sourceforge.net. A pure Python solution that
586-
works like expect is ` pexpect <http://pexpect.sourceforge.net>`_.
582+
works like expect is `pexpect <http://pypi.python.org/pypi/pexpect/>`_.
587583

588584

589585
How do I access the serial (RS232) port?

Doc/faq/programming.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ plug-ins to add a custom feature. In addition to the bug checking that
6767
PyChecker performs, Pylint offers some additional features such as checking line
6868
length, whether variable names are well-formed according to your coding
6969
standard, whether declared interfaces are fully implemented, and more.
70-
http://www.logilab.org/projects/pylint/documentation provides a full list of
71-
Pylint's features.
70+
http://www.logilab.org/card/pylint_manual provides a full list of Pylint's
71+
features.
7272

7373

7474
How can I create a stand-alone binary from a Python script?
@@ -1141,7 +1141,7 @@ use a list comprehension::
11411141
A = [[None] * w for i in range(h)]
11421142

11431143
Or, you can use an extension that provides a matrix datatype; `Numeric Python
1144-
<http://www.pfdubois.com/numpy/>`_ is the best known.
1144+
<http://numpy.scipy.org/>`_ is the best known.
11451145

11461146

11471147
How do I apply a method to a sequence of objects?

Doc/faq/windows.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -389,10 +389,10 @@ need)::
389389
.py :REG_SZ: c:\<path to python>\python.exe -u %s %s
390390

391391
This line will allow you to call your script with a simple reference like:
392-
http://yourserver/scripts/yourscript.py provided "scripts" is an "executable"
393-
directory for your server (which it usually is by default). The "-u" flag
394-
specifies unbuffered and binary mode for stdin - needed when working with binary
395-
data.
392+
``http://yourserver/scripts/yourscript.py`` provided "scripts" is an
393+
"executable" directory for your server (which it usually is by default). The
394+
:option:`-u` flag specifies unbuffered and binary mode for stdin - needed when
395+
working with binary data.
396396

397397
In addition, it is recommended that using ".py" may not be a good idea for the
398398
file extensions when used in this context (you might want to reserve ``*.py``
@@ -517,7 +517,7 @@ Why doesn't os.popen()/win32pipe.popen() work on Win9x?
517517
There is a bug in Win9x that prevents os.popen/win32pipe.popen* from
518518
working. The good news is there is a way to work around this problem. The
519519
Microsoft Knowledge Base article that you need to lookup is: Q150956. You will
520-
find links to the knowledge base at: http://www.microsoft.com/kb.
520+
find links to the knowledge base at: http://support.microsoft.com/.
521521

522522

523523
PyRun_SimpleFile() crashes on Windows but not on Unix; why?
@@ -604,4 +604,4 @@ Tim Peters:
604604
we can't fix it).
605605

606606
David A Burton has written a little program to fix this. Go to
607-
http://www.burtonsys.com/download.html and click on "ctl3dfix.zip".
607+
http://www.burtonsys.com/downloads.html and click on "ctl3dfix.zip".

0 commit comments

Comments
 (0)
0