| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 38bbc48 commit 2ee470f
46 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -83,11 +83,11 @@ The following functions provide locale-independent string to number conversions. | |||
| 83 | 83 | ||
| 84 | 84 | .. cfunction:: char * PyOS_stricmp(char *s1, char *s2) | |
| 85 | 85 | ||
| 86 | - Case insensitive comparison of strings. The functions works almost | ||
| 87 | - identical to :cfunc:`strcmp` except that it ignores the case. | ||
| 86 | + Case insensitive comparison of strings. The function works almost | ||
| 87 | + identically to :cfunc:`strcmp` except that it ignores the case. | ||
| 88 | 88 | ||
| 89 | 89 | ||
| 90 | 90 | .. cfunction:: char * PyOS_strnicmp(char *s1, char *s2, Py_ssize_t size) | |
| 91 | 91 | ||
| 92 | - Case insensitive comparison of strings. The functions works almost | ||
| 93 | - identical to :cfunc:`strncmp` except that it ignores the case. | ||
| 92 | + Case insensitive comparison of strings. The function works almost | ||
| 93 | + identically to :cfunc:`strncmp` except that it ignores the case. | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -73,8 +73,7 @@ Floating Point Objects | |||
| 73 | 73 | ||
| 74 | 74 | Return the minimum normalized positive float *DBL_MIN* as C :ctype:`double`. | |
| 75 | 75 | ||
| 76 | - .. cfunction:: void PyFloat_CompactFreeList(size_t *bc, size_t *bf, size_t *sum) | ||
| 76 | + .. cfunction:: int PyFloat_ClearFreeList(void) | ||
| 77 | 77 | ||
| 78 | - Compact the float free list. *bc* is the number of allocated blocks before | ||
| 79 | - blocks are freed, *bf* is the number of freed blocks and *sum* is the number | ||
| 80 | - of remaining objects in the blocks. | ||
| 78 | + Clear the float free list. Return the number of items that could not | ||
| 79 | + be freed. | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -143,6 +143,10 @@ Sequence Protocol | |||
| 143 | 143 | ||
| 144 | 144 | Return the underlying array of PyObject pointers. Assumes that *o* was returned | |
| 145 | 145 | by :cfunc:`PySequence_Fast` and *o* is not *NULL*. | |
| 146 | + | ||
| 147 | + Note, if a list gets resized, the reallocation may relocate the items array. | ||
| 148 | + So, only use the underlying array pointer in contexts where the sequence | ||
| 149 | + cannot change. | ||
| 146 | 150 | ||
| 147 | 151 | ||
| 148 | 152 | .. cfunction:: PyObject* PySequence_ITEM(PyObject *o, Py_ssize_t i) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,7 +23,7 @@ C++. | |||
| 23 | 23 | ||
| 24 | 24 | This chapter mentions a number of filenames that include an encoded Python | |
| 25 | 25 | version number. These filenames are represented with the version number shown | |
| 26 | - as ``XY``; in practive, ``'X'`` will be the major version number and ``'Y'`` | ||
| 26 | + as ``XY``; in practice, ``'X'`` will be the major version number and ``'Y'`` | ||
| 27 | 27 | will be the minor version number of the Python release you're working with. For | |
| 28 | 28 | example, if you are using Python 2.2.1, ``XY`` will actually be ``22``. | |
| 29 | 29 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,7 +16,7 @@ | |||
| 16 | 16 | ||
| 17 | 17 | * To document when incompatible changes were introduced, and when they will be | |
| 18 | 18 | --- or were --- made mandatory. This is a form of executable documentation, and | |
| 19 | - can be inspected programatically via importing :mod:`__future__` and examining | ||
| 19 | + can be inspected programmatically via importing :mod:`__future__` and examining | ||
| 20 | 20 | its contents. | |
| 21 | 21 | ||
| 22 | 22 | Each statement in :file:`__future__.py` is of the form:: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1781,8 +1781,8 @@ Utility functions | |||
| 1781 | 1781 | .. function:: byref(obj[, offset]) | |
| 1782 | 1782 | ||
| 1783 | 1783 | Returns a light-weight pointer to ``obj``, which must be an | |
| 1784 | - instance of a ctypes type. ``offset`` defaults to zero, it must be | ||
| 1785 | - an integer which is added to the internal pointer value. | ||
| 1784 | + instance of a ctypes type. ``offset`` defaults to zero, and must be | ||
| 1785 | + an integer that will be added to the internal pointer value. | ||
| 1786 | 1786 | ||
| 1787 | 1787 | ``byref(obj, offset)`` corresponds to this C code:: | |
| 1788 | 1788 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -300,7 +300,7 @@ followed by ``lines`` for the text version or ``binary`` for the binary version. | |||
| 300 | 300 | ||
| 301 | 301 | Send a ``QUIT`` command to the server and close the connection. This is the | |
| 302 | 302 | "polite" way to close a connection, but it may raise an exception of the server | |
| 303 | - reponds with an error to the ``QUIT`` command. This implies a call to the | ||
| 303 | + responds with an error to the ``QUIT`` command. This implies a call to the | ||
| 304 | 304 | :meth:`close` method which renders the :class:`FTP` instance useless for | |
| 305 | 305 | subsequent calls (see below). | |
| 306 | 306 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1186,6 +1186,7 @@ are always available. They are listed here in alphabetical order. | |||
| 1186 | 1186 | care about trailing, unmatched values from the longer iterables. If those | |
| 1187 | 1187 | values are important, use :func:`itertools.zip_longest` instead. | |
| 1188 | 1188 | ||
| 1189 | + | ||
| 1189 | 1190 | .. rubric:: Footnotes | |
| 1190 | 1191 | ||
| 1191 | 1192 | .. [#] Specifying a buffer size currently has no effect on systems that don't have | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -44,6 +44,11 @@ The :mod:`gc` module provides the following functions: | |||
| 44 | 44 | :exc:`ValueError` is raised if the generation number is invalid. The number of | |
| 45 | 45 | unreachable objects found is returned. | |
| 46 | 46 | ||
| 47 | + The free lists maintained for a number of builtin types are cleared | ||
| 48 | + whenever a full collection or collection of the highest generation (2) | ||
| 49 | + is run. Not all items in some free lists may be freed due to the | ||
| 50 | + particular implementation, in particular :class:`float`. | ||
| 51 | + | ||
| 47 | 52 | ||
| 48 | 53 | .. function:: set_debug(flags) | |
| 49 | 54 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -158,7 +158,7 @@ However, if you really do need to use some shared data then | |||
| 158 | 158 | ||
| 159 | 159 | The ``'d'`` and ``'i'`` arguments used when creating ``num`` and ``arr`` are | |
| 160 | 160 | typecodes of the kind used by the :mod:`array` module: ``'d'`` indicates a | |
| 161 | - double precision float and ``'i'`` inidicates a signed integer. These shared | ||
| 161 | + double precision float and ``'i'`` indicates a signed integer. These shared | ||
| 162 | 162 | objects will be process and thread safe. | |
| 163 | 163 | ||
| 164 | 164 | For more flexibility in using shared memory one can use the | |
@@ -168,7 +168,7 @@ However, if you really do need to use some shared data then | |||
| 168 | 168 | **Server process** | |
| 169 | 169 | ||
| 170 | 170 | A manager object returned by :func:`Manager` controls a server process which | |
| 171 | - holds python objects and allows other processes to manipulate them using | ||
| 171 | + holds Python objects and allows other processes to manipulate them using | ||
| 172 | 172 | proxies. | |
| 173 | 173 | ||
| 174 | 174 | A manager returned by :func:`Manager` will support types :class:`list`, | |
@@ -451,7 +451,7 @@ Note that one can also create a shared queue by using a manager object -- see | |||
| 451 | 451 | This means that if you try joining that process you may get a deadlock unless | |
| 452 | 452 | you are sure that all items which have been put on the queue have been | |
| 453 | 453 | consumed. Similarly, if the child process is non-daemonic then the parent | |
| 454 | - process may hang on exit when it tries to join all it non-daemonic children. | ||
| 454 | + process may hang on exit when it tries to join all its non-daemonic children. | ||
| 455 | 455 | ||
| 456 | 456 | Note that a queue created using a manager does not have this issue. See | |
| 457 | 457 | :ref:`multiprocessing-programming`. | |
@@ -532,7 +532,8 @@ For an example of the usage of queues for interprocess communication see | |||
| 532 | 532 | Equivalent to ``get(False)``. | |
| 533 | 533 | ||
| 534 | 534 | :class:`multiprocessing.Queue` has a few additional methods not found in | |
| 535 | - :class:`queue.Queue` which are usually unnecessary: | ||
| 535 | + :class:`queue.Queue`. These methods are usually unnecessary for most | ||
| 536 | + code: | ||
| 536 | 537 | ||
| 537 | 538 | .. method:: close() | |
| 538 | 539 | ||
@@ -772,7 +773,7 @@ Synchronization primitives | |||
| 772 | 773 | ~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| 773 | 774 | ||
| 774 | 775 | Generally synchronization primitives are not as necessary in a multiprocess | |
| 775 | - program as they are in a mulithreaded program. See the documentation for | ||
| 776 | + program as they are in a multithreaded program. See the documentation for | ||
| 776 | 777 | :mod:`threading` module. | |
| 777 | 778 | ||
| 778 | 779 | Note that one can also create synchronization primitives by using a manager | |
@@ -782,7 +783,7 @@ object -- see :ref:`multiprocessing-managers`. | |||
| 782 | 783 | ||
| 783 | 784 | A bounded semaphore object: a clone of :class:`threading.BoundedSemaphore`. | |
| 784 | 785 | ||
| 785 | - (On Mac OSX this is indistiguishable from :class:`Semaphore` because | ||
| 786 | + (On Mac OSX this is indistinguishable from :class:`Semaphore` because | ||
| 786 | 787 | ``sem_getvalue()`` is not implemented on that platform). | |
| 787 | 788 | ||
| 788 | 789 | .. class:: Condition([lock]) | |
@@ -891,8 +892,8 @@ processes. | |||
| 891 | 892 | ||
| 892 | 893 | .. note:: | |
| 893 | 894 | ||
| 894 | - Although it is posible to store a pointer in shared memory remember that this | ||
| 895 | - will refer to a location in the address space of a specific process. | ||
| 895 | + Although it is possible to store a pointer in shared memory remember that | ||
| 896 | + this will refer to a location in the address space of a specific process. | ||
| 896 | 897 | However, the pointer is quite likely to be invalid in the context of a second | |
| 897 | 898 | process and trying to dereference the pointer from the second process may | |
| 898 | 899 | cause a crash. | |
@@ -1081,7 +1082,7 @@ their parent process exits. The manager classes are defined in the | |||
| 1081 | 1082 | ||
| 1082 | 1083 | Start a subprocess to start the manager. | |
| 1083 | 1084 | ||
| 1084 | - .. method:: server_forever() | ||
| 1085 | + .. method:: serve_forever() | ||
| 1085 | 1086 | ||
| 1086 | 1087 | Run the server in the current process. | |
| 1087 | 1088 | ||
@@ -1774,7 +1775,7 @@ handler type) for messages from different processes to get mixed up. | |||
| 1774 | 1775 | handler which sends output to :data:`sys.stderr` using format | |
| 1775 | 1776 | ``'[%(levelname)s/%(processName)s] %(message)s'``. (The logger allows use of | |
| 1776 | 1777 | the non-standard ``'%(processName)s'`` format.) Message sent to this logger | |
| 1777 | - will not by default propogate to the root logger. | ||
| 1778 | + will not by default propagate to the root logger. | ||
| 1778 | 1779 | ||
| 1779 | 1780 | Note that on Windows child processes will only inherit the level of the | |
| 1780 | 1781 | parent process's logger -- any other customization of the logger will not be | |
| Back | FazBrowse Home | New Git URL |
0 commit comments