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

Skip to content

Commit d23f822

Browse files
committed
Merged revisions 70712,70714,70764-70765,70769-70771,70773,70776-70777,70788-70789,70824,70828,70832,70836,70842,70851,70855,70857,70866-70872,70883,70885,70893-70894,70896-70897,70903,70905-70907,70915,70927,70933,70951,70960,70962-70964,70998,71001,71006,71008,71010-71011,71019,71037,71056,71094,71101-71103,71106,71119,71123,71149-71150,71203,71212,71214-71217,71221,71240 via svnmerge from
svn+ssh://[email protected]/python/trunk ........ r70712 | benjamin.peterson | 2009-03-30 10:15:38 -0500 (Mon, 30 Mar 2009) | 1 line don't rely on the order dict repr #5605 ........ r70714 | brett.cannon | 2009-03-30 10:20:53 -0500 (Mon, 30 Mar 2009) | 1 line Add an entry to developers.txt. ........ r70764 | martin.v.loewis | 2009-03-30 17:06:33 -0500 (Mon, 30 Mar 2009) | 2 lines Add several VM developers. ........ r70765 | georg.brandl | 2009-03-30 17:09:34 -0500 (Mon, 30 Mar 2009) | 1 line #5199: make warning about vars() assignment more visible. ........ r70769 | andrew.kuchling | 2009-03-30 17:29:53 -0500 (Mon, 30 Mar 2009) | 1 line Remove comment ........ r70770 | andrew.kuchling | 2009-03-30 17:30:20 -0500 (Mon, 30 Mar 2009) | 1 line Add several items and placeholders ........ r70771 | andrew.kuchling | 2009-03-30 17:31:11 -0500 (Mon, 30 Mar 2009) | 1 line Many edits ........ r70773 | georg.brandl | 2009-03-30 17:43:00 -0500 (Mon, 30 Mar 2009) | 1 line #5039: make it clear that the impl. note refers to CPython. ........ r70776 | andrew.kuchling | 2009-03-30 18:08:24 -0500 (Mon, 30 Mar 2009) | 1 line typo fix ........ r70777 | andrew.kuchling | 2009-03-30 18:09:46 -0500 (Mon, 30 Mar 2009) | 1 line Add more items ........ r70788 | andrew.kuchling | 2009-03-30 20:21:01 -0500 (Mon, 30 Mar 2009) | 1 line Add various items ........ r70789 | georg.brandl | 2009-03-30 20:25:15 -0500 (Mon, 30 Mar 2009) | 1 line Fix a wrong struct field assignment (docstring as closure). ........ r70824 | georg.brandl | 2009-03-31 10:43:20 -0500 (Tue, 31 Mar 2009) | 1 line #5519: remove reference to Kodos, which seems dead. ........ r70828 | georg.brandl | 2009-03-31 10:50:16 -0500 (Tue, 31 Mar 2009) | 1 line #5581: fget argument of abstractproperty is optional as well. ........ r70832 | georg.brandl | 2009-03-31 11:31:11 -0500 (Tue, 31 Mar 2009) | 1 line #1386675: specify WindowsError as the exception, because it has a winerror attribute that EnvironmentError doesnt have. ........ r70836 | georg.brandl | 2009-03-31 11:50:25 -0500 (Tue, 31 Mar 2009) | 1 line #5417: replace references to undocumented functions by ones to documented functions. ........ r70842 | georg.brandl | 2009-03-31 12:13:06 -0500 (Tue, 31 Mar 2009) | 1 line #970783: document PyObject_Generic[GS]etAttr. ........ r70851 | georg.brandl | 2009-03-31 13:26:55 -0500 (Tue, 31 Mar 2009) | 1 line #837577: note cryptic return value of spawn*e on invalid env dicts. ........ r70855 | georg.brandl | 2009-03-31 13:30:37 -0500 (Tue, 31 Mar 2009) | 1 line #5245: note that PyRun_SimpleString doesnt return on SystemExit. ........ r70857 | georg.brandl | 2009-03-31 13:33:10 -0500 (Tue, 31 Mar 2009) | 1 line #5227: note that Py_Main doesnt return on SystemExit. ........ r70866 | georg.brandl | 2009-03-31 14:06:57 -0500 (Tue, 31 Mar 2009) | 1 line #4882: document named group behavior a bit better. ........ r70867 | georg.brandl | 2009-03-31 14:10:35 -0500 (Tue, 31 Mar 2009) | 1 line #1096310: document usage of sys.__std*__ a bit better. ........ r70868 | georg.brandl | 2009-03-31 14:12:17 -0500 (Tue, 31 Mar 2009) | 1 line #5190: export make_option in __all__. ........ r70869 | georg.brandl | 2009-03-31 14:14:42 -0500 (Tue, 31 Mar 2009) | 1 line Fix-up unwanted change. ........ r70870 | georg.brandl | 2009-03-31 14:26:24 -0500 (Tue, 31 Mar 2009) | 1 line #4411: document mro() and __mro__. (I hope I got it right.) ........ r70871 | georg.brandl | 2009-03-31 14:30:56 -0500 (Tue, 31 Mar 2009) | 1 line #5618: fix typo. ........ r70872 | r.david.murray | 2009-03-31 14:31:17 -0500 (Tue, 31 Mar 2009) | 3 lines Delete out-of-date and little-known README from the test directory by consensus of devs at pycon sprint. ........ r70883 | georg.brandl | 2009-03-31 15:41:08 -0500 (Tue, 31 Mar 2009) | 1 line #1674032: return value of flag from Event.wait(). OKed by Guido. ........ r70885 | tarek.ziade | 2009-03-31 15:48:31 -0500 (Tue, 31 Mar 2009) | 1 line using log.warn for sys.stderr ........ r70893 | georg.brandl | 2009-03-31 15:56:32 -0500 (Tue, 31 Mar 2009) | 1 line #1530012: move TQS section before raw strings. ........ r70894 | benjamin.peterson | 2009-03-31 16:06:30 -0500 (Tue, 31 Mar 2009) | 1 line take the usual lock precautions around _active_limbo_lock ........ r70896 | georg.brandl | 2009-03-31 16:15:33 -0500 (Tue, 31 Mar 2009) | 1 line #5598: document DocFileSuite *args argument. ........ r70897 | benjamin.peterson | 2009-03-31 16:34:42 -0500 (Tue, 31 Mar 2009) | 1 line fix Thread.ident when it is the main thread or a dummy thread #5632 ........ r70903 | georg.brandl | 2009-03-31 16:45:18 -0500 (Tue, 31 Mar 2009) | 1 line #1676135: remove trailing slashes from --prefix argument. ........ r70905 | georg.brandl | 2009-03-31 17:03:40 -0500 (Tue, 31 Mar 2009) | 1 line #5563: more documentation for bdist_msi. ........ r70906 | georg.brandl | 2009-03-31 17:11:53 -0500 (Tue, 31 Mar 2009) | 1 line #1651995: fix _convert_ref for non-ASCII characters. ........ r70907 | georg.brandl | 2009-03-31 17:18:19 -0500 (Tue, 31 Mar 2009) | 1 line #3427: document correct return type for urlopen().info(). ........ r70915 | georg.brandl | 2009-03-31 17:40:16 -0500 (Tue, 31 Mar 2009) | 1 line #5018: remove confusing paragraph. ........ r70927 | georg.brandl | 2009-03-31 18:01:27 -0500 (Tue, 31 Mar 2009) | 1 line Dont shout to users. ........ r70933 | georg.brandl | 2009-03-31 19:04:33 -0500 (Tue, 31 Mar 2009) | 2 lines Issue #5635: Fix running test_sys with tracing enabled. ........ r70951 | georg.brandl | 2009-04-01 09:02:27 -0500 (Wed, 01 Apr 2009) | 1 line Add Maksim, who worked on several issues at the sprint. ........ r70960 | jesse.noller | 2009-04-01 11:42:19 -0500 (Wed, 01 Apr 2009) | 1 line Issue 3270: document Listener address restrictions on windows ........ r70962 | brett.cannon | 2009-04-01 12:07:16 -0500 (Wed, 01 Apr 2009) | 2 lines Ron DuPlain was given commit privileges at PyCon 2009 to work on 3to2. ........ r70963 | georg.brandl | 2009-04-01 12:46:01 -0500 (Wed, 01 Apr 2009) | 1 line #5655: fix docstring oversight. ........ r70964 | brett.cannon | 2009-04-01 12:52:13 -0500 (Wed, 01 Apr 2009) | 2 lines Paul Kippes was given commit privileges to work on 3to2. ........ r70998 | georg.brandl | 2009-04-01 16:54:21 -0500 (Wed, 01 Apr 2009) | 1 line In Pdb, stop assigning values to __builtin__._ which interferes with the one commonly installed by gettext. ........ r71001 | brett.cannon | 2009-04-01 18:01:12 -0500 (Wed, 01 Apr 2009) | 3 lines Add my initials to Misc/developers.txt. Names are now sorted by number of characters in the person's name. ........ r71006 | georg.brandl | 2009-04-01 18:32:17 -0500 (Wed, 01 Apr 2009) | 1 line Cache the f_locals dict of the current frame, since every access to frame.f_locals overrides its contents with the real locals which undoes modifications made by the debugging user. ........ r71008 | andrew.kuchling | 2009-04-01 19:02:14 -0500 (Wed, 01 Apr 2009) | 1 line Typo fix ........ r71010 | benjamin.peterson | 2009-04-01 19:11:52 -0500 (Wed, 01 Apr 2009) | 1 line fix markup ........ r71011 | benjamin.peterson | 2009-04-01 19:12:47 -0500 (Wed, 01 Apr 2009) | 1 line this should be :noindex: ........ r71019 | georg.brandl | 2009-04-01 21:00:01 -0500 (Wed, 01 Apr 2009) | 1 line Fix test_doctest, missed two assignments to curframe. ........ r71037 | r.david.murray | 2009-04-01 23:34:04 -0500 (Wed, 01 Apr 2009) | 6 lines Clarify that datetime strftime does not produce leap seconds and datetime strptime does not accept it in the strftime behavior section of the datetime docs. Closes issue 2568. ........ r71056 | georg.brandl | 2009-04-02 12:43:07 -0500 (Thu, 02 Apr 2009) | 2 lines Actually the displayhook should print the repr. ........ r71094 | vinay.sajip | 2009-04-03 05:23:18 -0500 (Fri, 03 Apr 2009) | 1 line Added warning about logging use from asynchronous signal handlers. ........ r71101 | andrew.kuchling | 2009-04-03 16:43:00 -0500 (Fri, 03 Apr 2009) | 1 line Add some items ........ r71102 | andrew.kuchling | 2009-04-03 16:44:49 -0500 (Fri, 03 Apr 2009) | 1 line Fix 'the the'; grammar fix ........ r71103 | andrew.kuchling | 2009-04-03 16:45:29 -0500 (Fri, 03 Apr 2009) | 1 line Fix 'the the' duplication ........ r71106 | vinay.sajip | 2009-04-03 16:58:16 -0500 (Fri, 03 Apr 2009) | 1 line Clarified warning about logging use from asynchronous signal handlers. ........ r71119 | raymond.hettinger | 2009-04-04 00:37:47 -0500 (Sat, 04 Apr 2009) | 1 line Add helpful link. ........ r71123 | r.david.murray | 2009-04-04 01:39:56 -0500 (Sat, 04 Apr 2009) | 2 lines Fix error in description of 'oct' (issue 5678). ........ r71149 | georg.brandl | 2009-04-04 08:42:39 -0500 (Sat, 04 Apr 2009) | 1 line #5642: clarify map() compatibility to the builtin. ........ r71150 | georg.brandl | 2009-04-04 08:45:49 -0500 (Sat, 04 Apr 2009) | 1 line #5601: clarify that webbrowser is not meant for file names. ........ r71203 | benjamin.peterson | 2009-04-04 18:46:34 -0500 (Sat, 04 Apr 2009) | 1 line note how using iter* are unsafe while mutating and document iter(dict) ........ r71212 | georg.brandl | 2009-04-05 05:24:20 -0500 (Sun, 05 Apr 2009) | 1 line #1742837: expand HTTP server docs, and fix SocketServer ones to document methods as methods, not functions. ........ r71214 | georg.brandl | 2009-04-05 05:29:57 -0500 (Sun, 05 Apr 2009) | 1 line Normalize spelling of Mac OS X. ........ r71215 | georg.brandl | 2009-04-05 05:32:26 -0500 (Sun, 05 Apr 2009) | 1 line Avoid sure signs of a diseased mind. ........ r71216 | georg.brandl | 2009-04-05 05:41:02 -0500 (Sun, 05 Apr 2009) | 1 line #1718017: document the relation of os.path and the posixpath, ntpath etc. modules better. ........ r71217 | georg.brandl | 2009-04-05 05:48:47 -0500 (Sun, 05 Apr 2009) | 1 line #1726172: dont raise an unexpected IndexError if a voidresp() call has an empty response. ........ r71221 | vinay.sajip | 2009-04-05 06:06:24 -0500 (Sun, 05 Apr 2009) | 1 line Issue #5695: Moved logging.captureWarnings() call inside with statement in WarningsTest.test_warnings. ........ r71240 | georg.brandl | 2009-04-05 09:40:06 -0500 (Sun, 05 Apr 2009) | 1 line #5370: doc update about unpickling objects with custom __getattr__ etc. methods. ........
1 parent 5b9082a commit d23f822

50 files changed

Lines changed: 678 additions & 759 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/init.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ created.
787787
Asynchronous Notifications
788788
==========================
789789

790-
A mechanism is provided to make asynchronous notifications to the the main
790+
A mechanism is provided to make asynchronous notifications to the main
791791
interpreter thread. These notifications take the form of a function
792792
pointer and a void argument.
793793

Doc/c-api/number.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,8 @@ Number Protocol
264264

265265
.. cfunction:: PyObject* PyNumber_ToBase(PyObject *n, int base)
266266

267-
Returns the the integer *n* converted to *base* as a string with a base
268-
marker of ``'0b'``, ``'0o'``, or ``'0x'`` if appended applicable. When
267+
Returns the integer *n* converted to *base* as a string with a base
268+
marker of ``'0b'``, ``'0o'``, or ``'0x'`` if applicable. When
269269
*base* is not 2, 8, 10, or 16, the format is ``'x#num'`` where x is the
270270
base. If *n* is not an int object, it is converted with
271271
:cfunc:`PyNumber_Index` first.

Doc/c-api/object.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ Object Protocol
4242
expression ``o.attr_name``.
4343

4444

45+
.. cfunction:: PyObject* PyObject_GenericGetAttr(PyObject *o, PyObject *name)
46+
47+
Generic attribute getter function that is meant to be put into a type
48+
object's ``tp_getattro`` slot. It looks for a descriptor in the dictionary
49+
of classes in the object's MRO as well as an attribute in the object's
50+
:attr:`__dict__` (if present). As outlined in :ref:`descriptors`, data
51+
descriptors take preference over instance attributes, while non-data
52+
descriptors don't. Otherwise, an :exc:`AttributeError` is raised.
53+
54+
4555
.. cfunction:: int PyObject_SetAttr(PyObject *o, PyObject *attr_name, PyObject *v)
4656

4757
Set the value of the attribute named *attr_name*, for object *o*, to the value
@@ -56,6 +66,16 @@ Object Protocol
5666
``o.attr_name = v``.
5767

5868

69+
.. cfunction:: int PyObject_GenericSetAttr(PyObject *o, PyObject *name, PyObject *value)
70+
71+
Generic attribute setter function that is meant to be put into a type
72+
object's ``tp_setattro`` slot. It looks for a data descriptor in the
73+
dictionary of classes in the object's MRO, and if found it takes preference
74+
over setting the attribute in the instance dictionary. Otherwise, the
75+
attribute is set in the object's :attr:`__dict__` (if present). Otherwise,
76+
an :exc:`AttributeError` is raised and ``-1`` is returned.
77+
78+
5979
.. cfunction:: int PyObject_DelAttr(PyObject *o, PyObject *attr_name)
6080

6181
Delete attribute named *attr_name*, for object *o*. Returns ``-1`` on failure.

Doc/c-api/structures.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ definition with the same method name.
241241
T_OBJECT_EX PyObject \*
242242
T_CHAR char
243243
T_BYTE char
244-
T_UNBYTE unsigned char
244+
T_UBYTE unsigned char
245245
T_UINT unsigned int
246246
T_USHORT unsigned short
247247
T_ULONG unsigned long

Doc/c-api/veryhigh.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ the same library that the Python runtime is using.
3838
interpreter exits due to an exception, or ``2`` if the parameter
3939
list does not represent a valid Python command line.
4040

41+
Note that if an otherwise unhandled :exc:`SystemError` is raised, this
42+
function will not return ``1``, but exit the process, as long as
43+
``Py_InspectFlag`` is not set.
44+
4145

4246
.. cfunction:: int PyRun_AnyFile(FILE *fp, const char *filename)
4347

@@ -80,6 +84,10 @@ the same library that the Python runtime is using.
8084
there was an error, there is no way to get the exception information. For the
8185
meaning of *flags*, see below.
8286

87+
Note that if an otherwise unhandled :exc:`SystemError` is raised, this
88+
function will not return ``-1``, but exit the process, as long as
89+
``Py_InspectFlag`` is not set.
90+
8391

8492
.. cfunction:: int PyRun_SimpleFile(FILE *fp, const char *filename)
8593

Doc/distutils/apiref.rst

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,8 +1050,8 @@ This module contains some utility functions for operating on individual files.
10501050

10511051
.. warning::
10521052

1053-
Handles cross-device moves on Unix using :func:`copy_file`. What about other
1054-
systems???
1053+
Handles cross-device moves on Unix using :func:`copy_file`. What about
1054+
other systems?
10551055

10561056

10571057
.. function:: write_file(filename, contents)
@@ -1091,17 +1091,17 @@ other utility module.
10911091

10921092
For non-POSIX platforms, currently just returns ``sys.platform``.
10931093

1094-
For MacOS X systems the OS version reflects the minimal version on which
1094+
For Mac OS X systems the OS version reflects the minimal version on which
10951095
binaries will run (that is, the value of ``MACOSX_DEPLOYMENT_TARGET``
10961096
during the build of Python), not the OS version of the current system.
10971097

1098-
For universal binary builds on MacOS X the architecture value reflects
1098+
For universal binary builds on Mac OS X the architecture value reflects
10991099
the univeral binary status instead of the architecture of the current
11001100
processor. For 32-bit universal binaries the architecture is ``fat``,
11011101
for 64-bit universal binaries the architecture is ``fat64``, and
11021102
for 4-way universal binaries the architecture is ``universal``.
11031103

1104-
Examples of returned values on MacOS X:
1104+
Examples of returned values on Mac OS X:
11051105

11061106
* ``macosx-10.3-ppc``
11071107

@@ -1758,8 +1758,16 @@ This module supplies the abstract base class :class:`Command`.
17581758
.. module:: distutils.command.bdist_msi
17591759
:synopsis: Build a binary distribution as a Windows MSI file
17601760

1761+
.. class:: bdist_msi(Command)
17611762

1762-
.. % todo
1763+
Builds a `Windows Installer`_ (.msi) binary package.
1764+
1765+
.. _Windows Installer: http://msdn.microsoft.com/en-us/library/cc185688(VS.85).aspx
1766+
1767+
In most cases, the ``bdist_msi`` installer is a better choice than the
1768+
``bdist_wininst`` installer, because it provides better support for
1769+
Win64 platforms, allows administrators to perform non-interactive
1770+
installations, and allows installation through group policies.
17631771

17641772

17651773
:mod:`distutils.command.bdist_rpm` --- Build a binary distribution as a Redhat RPM and SRPM

Doc/extending/extending.rst

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -476,10 +476,10 @@ reference count of an object and are safe in the presence of *NULL* pointers
476476
(but note that *temp* will not be *NULL* in this context). More info on them
477477
in section :ref:`refcounts`.
478478

479-
.. index:: single: PyEval_CallObject()
479+
.. index:: single: PyObject_CallObject()
480480

481481
Later, when it is time to call the function, you call the C function
482-
:cfunc:`PyEval_CallObject`. This function has two arguments, both pointers to
482+
:cfunc:`PyObject_CallObject`. This function has two arguments, both pointers to
483483
arbitrary Python objects: the Python function, and the argument list. The
484484
argument list must always be a tuple object, whose length is the number of
485485
arguments. To call the Python function with no arguments, pass in NULL, or
@@ -495,24 +495,24 @@ or more format codes between parentheses. For example::
495495
...
496496
/* Time to call the callback */
497497
arglist = Py_BuildValue("(i)", arg);
498-
result = PyEval_CallObject(my_callback, arglist);
498+
result = PyObject_CallObject(my_callback, arglist);
499499
Py_DECREF(arglist);
500500

501-
:cfunc:`PyEval_CallObject` returns a Python object pointer: this is the return
502-
value of the Python function. :cfunc:`PyEval_CallObject` is
501+
:cfunc:`PyObject_CallObject` returns a Python object pointer: this is the return
502+
value of the Python function. :cfunc:`PyObject_CallObject` is
503503
"reference-count-neutral" with respect to its arguments. In the example a new
504504
tuple was created to serve as the argument list, which is :cfunc:`Py_DECREF`\
505505
-ed immediately after the call.
506506

507-
The return value of :cfunc:`PyEval_CallObject` is "new": either it is a brand
507+
The return value of :cfunc:`PyObject_CallObject` is "new": either it is a brand
508508
new object, or it is an existing object whose reference count has been
509509
incremented. So, unless you want to save it in a global variable, you should
510510
somehow :cfunc:`Py_DECREF` the result, even (especially!) if you are not
511511
interested in its value.
512512

513513
Before you do this, however, it is important to check that the return value
514514
isn't *NULL*. If it is, the Python function terminated by raising an exception.
515-
If the C code that called :cfunc:`PyEval_CallObject` is called from Python, it
515+
If the C code that called :cfunc:`PyObject_CallObject` is called from Python, it
516516
should now return an error indication to its Python caller, so the interpreter
517517
can print a stack trace, or the calling Python code can handle the exception.
518518
If this is not possible or desirable, the exception should be cleared by calling
@@ -524,7 +524,7 @@ If this is not possible or desirable, the exception should be cleared by calling
524524
Py_DECREF(result);
525525

526526
Depending on the desired interface to the Python callback function, you may also
527-
have to provide an argument list to :cfunc:`PyEval_CallObject`. In some cases
527+
have to provide an argument list to :cfunc:`PyObject_CallObject`. In some cases
528528
the argument list is also provided by the Python program, through the same
529529
interface that specified the callback function. It can then be saved and used
530530
in the same manner as the function object. In other cases, you may have to
@@ -535,7 +535,7 @@ event code, you might use the following code::
535535
PyObject *arglist;
536536
...
537537
arglist = Py_BuildValue("(l)", eventcode);
538-
result = PyEval_CallObject(my_callback, arglist);
538+
result = PyObject_CallObject(my_callback, arglist);
539539
Py_DECREF(arglist);
540540
if (result == NULL)
541541
return NULL; /* Pass error back */
@@ -547,19 +547,20 @@ the error check! Also note that strictly speaking this code is not complete:
547547
:cfunc:`Py_BuildValue` may run out of memory, and this should be checked.
548548

549549
You may also call a function with keyword arguments by using
550-
:cfunc:`PyEval_CallObjectWithKeywords`. As in the above example, we use
551-
:cfunc:`Py_BuildValue` to construct the dictionary. ::
550+
:cfunc:`PyObject_Call`, which supports arguments and keyword arguments. As in
551+
the above example, we use :cfunc:`Py_BuildValue` to construct the dictionary. ::
552552

553553
PyObject *dict;
554554
...
555555
dict = Py_BuildValue("{s:i}", "name", val);
556-
result = PyEval_CallObjectWithKeywords(my_callback, NULL, dict);
556+
result = PyObject_Call(my_callback, NULL, dict);
557557
Py_DECREF(dict);
558558
if (result == NULL)
559559
return NULL; /* Pass error back */
560560
/* Here maybe use the result */
561561
Py_DECREF(result);
562562

563+
563564
.. _parsetuple:
564565

565566
Extracting Parameters in Extension Functions

Doc/howto/cporting.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ In Python 3.0, there is only one integer type. It is called :func:`int` on the
9898
Python level, but actually corresponds to 2.x's :func:`long` type. In the
9999
C-API, ``PyInt_*`` functions are replaced by their ``PyLong_*`` neighbors. The
100100
best course of action here is using the ``PyInt_*`` functions aliased to
101-
``PyLong_*`` found in :file:`intobject.h`. The the abstract ``PyNumber_*`` APIs
101+
``PyLong_*`` found in :file:`intobject.h`. The abstract ``PyNumber_*`` APIs
102102
can also be used in some cases. ::
103103

104104
#include "Python.h"

Doc/library/abc.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ It also provides the following decorators:
132132
A class that has a metaclass derived from :class:`ABCMeta`
133133
cannot be instantiated unless all of its abstract methods and
134134
properties are overridden.
135-
The abstract methods can be called using any of the the normal 'super' call
135+
The abstract methods can be called using any of the normal 'super' call
136136
mechanisms.
137137

138138
Dynamically adding abstract methods to a class, or attempting to modify the
@@ -184,6 +184,7 @@ It also provides the following decorators:
184184
def setx(self, value): ...
185185
x = abstractproperty(getx, setx)
186186

187+
187188
.. rubric:: Footnotes
188189

189190
.. [#] C++ programmers should note that Python's virtual base class

Doc/library/doctest.rst

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ There are two main functions for creating :class:`unittest.TestSuite` instances
905905
from text files and modules with doctests:
906906

907907

908-
.. function:: DocFileSuite([module_relative][, package][, setUp][, tearDown][, globs][, optionflags][, parser][, encoding])
908+
.. function:: DocFileSuite(*paths, [module_relative][, package][, setUp][, tearDown][, globs][, optionflags][, parser][, encoding])
909909

910910
Convert doctest tests from one or more text files to a
911911
:class:`unittest.TestSuite`.
@@ -923,45 +923,47 @@ from text files and modules with doctests:
923923
Optional argument *module_relative* specifies how the filenames in *paths*
924924
should be interpreted:
925925

926-
* If *module_relative* is ``True`` (the default), then each filename specifies
927-
an OS-independent module-relative path. By default, this path is relative to
928-
the calling module's directory; but if the *package* argument is specified, then
929-
it is relative to that package. To ensure OS-independence, each filename should
930-
use ``/`` characters to separate path segments, and may not be an absolute path
931-
(i.e., it may not begin with ``/``).
932-
933-
* If *module_relative* is ``False``, then each filename specifies an OS-specific
934-
path. The path may be absolute or relative; relative paths are resolved with
935-
respect to the current working directory.
936-
937-
Optional argument *package* is a Python package or the name of a Python package
938-
whose directory should be used as the base directory for module-relative
939-
filenames. If no package is specified, then the calling module's directory is
940-
used as the base directory for module-relative filenames. It is an error to
941-
specify *package* if *module_relative* is ``False``.
942-
943-
Optional argument *setUp* specifies a set-up function for the test suite. This
944-
is called before running the tests in each file. The *setUp* function will be
945-
passed a :class:`DocTest` object. The setUp function can access the test
946-
globals as the *globs* attribute of the test passed.
947-
948-
Optional argument *tearDown* specifies a tear-down function for the test suite.
949-
This is called after running the tests in each file. The *tearDown* function
926+
* If *module_relative* is ``True`` (the default), then each filename in
927+
*paths* specifies an OS-independent module-relative path. By default, this
928+
path is relative to the calling module's directory; but if the *package*
929+
argument is specified, then it is relative to that package. To ensure
930+
OS-independence, each filename should use ``/`` characters to separate path
931+
segments, and may not be an absolute path (i.e., it may not begin with
932+
``/``).
933+
934+
* If *module_relative* is ``False``, then each filename in *paths* specifies
935+
an OS-specific path. The path may be absolute or relative; relative paths
936+
are resolved with respect to the current working directory.
937+
938+
Optional argument *package* is a Python package or the name of a Python
939+
package whose directory should be used as the base directory for
940+
module-relative filenames in *paths*. If no package is specified, then the
941+
calling module's directory is used as the base directory for module-relative
942+
filenames. It is an error to specify *package* if *module_relative* is
943+
``False``.
944+
945+
Optional argument *setUp* specifies a set-up function for the test suite.
946+
This is called before running the tests in each file. The *setUp* function
950947
will be passed a :class:`DocTest` object. The setUp function can access the
951948
test globals as the *globs* attribute of the test passed.
952949

950+
Optional argument *tearDown* specifies a tear-down function for the test
951+
suite. This is called after running the tests in each file. The *tearDown*
952+
function will be passed a :class:`DocTest` object. The setUp function can
953+
access the test globals as the *globs* attribute of the test passed.
954+
953955
Optional argument *globs* is a dictionary containing the initial global
954956
variables for the tests. A new copy of this dictionary is created for each
955957
test. By default, *globs* is a new empty dictionary.
956958

957959
Optional argument *optionflags* specifies the default doctest options for the
958960
tests, created by or-ing together individual option flags. See section
959-
:ref:`doctest-options`. See function :func:`set_unittest_reportflags` below for
960-
a better way to set reporting options.
961+
:ref:`doctest-options`. See function :func:`set_unittest_reportflags` below
962+
for a better way to set reporting options.
961963

962-
Optional argument *parser* specifies a :class:`DocTestParser` (or subclass) that
963-
should be used to extract tests from the files. It defaults to a normal parser
964-
(i.e., ``DocTestParser()``).
964+
Optional argument *parser* specifies a :class:`DocTestParser` (or subclass)
965+
that should be used to extract tests from the files. It defaults to a normal
966+
parser (i.e., ``DocTestParser()``).
965967

966968
Optional argument *encoding* specifies an encoding that should be used to
967969
convert the file to unicode.

0 commit comments

Comments
 (0)