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

Skip to content

Commit d08effe

Browse files
committed
Some formatting & grammar fixes for the multiprocessing doc
1 parent a6c4a10 commit d08effe

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

Doc/library/multiprocessing.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ into Python 2.5's :class:`queue.Queue` class.
472472

473473
If you use :class:`JoinableQueue` then you **must** call
474474
:meth:`JoinableQueue.task_done` for each task removed from the queue or else the
475-
semaphore used to count the number of unfinished tasks may eventually overflow
475+
semaphore used to count the number of unfinished tasks may eventually overflow,
476476
raising an exception.
477477

478478
Note that one can also create a shared queue by using a manager object -- see
@@ -490,7 +490,7 @@ Note that one can also create a shared queue by using a manager object -- see
490490

491491
If a process is killed using :meth:`Process.terminate` or :func:`os.kill`
492492
while it is trying to use a :class:`Queue`, then the data in the queue is
493-
likely to become corrupted. This may cause any other processes to get an
493+
likely to become corrupted. This may cause any other process to get an
494494
exception when it tries to use the queue later on.
495495

496496
.. warning::
@@ -692,7 +692,7 @@ Miscellaneous
692692
(By default :data:`sys.executable` is used). Embedders will probably need to
693693
do some thing like ::
694694

695-
setExecutable(os.path.join(sys.exec_prefix, 'pythonw.exe'))
695+
set_executable(os.path.join(sys.exec_prefix, 'pythonw.exe'))
696696

697697
before they can create child processes. (Windows only)
698698

@@ -711,7 +711,7 @@ Connection Objects
711711
Connection objects allow the sending and receiving of picklable objects or
712712
strings. They can be thought of as message oriented connected sockets.
713713

714-
Connection objects usually created using :func:`Pipe` -- see also
714+
Connection objects are usually created using :func:`Pipe` -- see also
715715
:ref:`multiprocessing-listeners-clients`.
716716

717717
.. class:: Connection
@@ -732,7 +732,7 @@ Connection objects usually created using :func:`Pipe` -- see also
732732

733733
.. method:: fileno()
734734

735-
Returns the file descriptor or handle used by the connection.
735+
Return the file descriptor or handle used by the connection.
736736

737737
.. method:: close()
738738

@@ -756,7 +756,7 @@ Connection objects usually created using :func:`Pipe` -- see also
756756
If *offset* is given then data is read from that position in *buffer*. If
757757
*size* is given then that many bytes will be read from buffer. Very large
758758
buffers (approximately 32 MB+, though it depends on the OS) may raise a
759-
ValueError exception
759+
:exc:`ValueError` exception
760760

761761
.. method:: recv_bytes([maxlength])
762762

@@ -1329,7 +1329,7 @@ Customized managers
13291329
>>>>>>>>>>>>>>>>>>>
13301330

13311331
To create one's own manager, one creates a subclass of :class:`BaseManager` and
1332-
use the :meth:`~BaseManager.register` classmethod to register new types or
1332+
uses the :meth:`~BaseManager.register` classmethod to register new types or
13331333
callables with the manager class. For example::
13341334

13351335
from multiprocessing.managers import BaseManager
@@ -1580,9 +1580,9 @@ with the :class:`Pool` class.
15801580
.. method:: apply(func[, args[, kwds]])
15811581

15821582
Call *func* with arguments *args* and keyword arguments *kwds*. It blocks
1583-
till the result is ready. Given this blocks, :meth:`apply_async` is better
1584-
suited for performing work in parallel. Additionally, the passed in
1585-
function is only executed in one of the workers of the pool.
1583+
until the result is ready. Given this blocks, :meth:`apply_async` is
1584+
better suited for performing work in parallel. Additionally, *func*
1585+
is only executed in one of the workers of the pool.
15861586

15871587
.. method:: apply_async(func[, args[, kwds[, callback[, error_callback]]]])
15881588

@@ -1603,7 +1603,7 @@ with the :class:`Pool` class.
16031603
.. method:: map(func, iterable[, chunksize])
16041604

16051605
A parallel equivalent of the :func:`map` built-in function (it supports only
1606-
one *iterable* argument though). It blocks till the result is ready.
1606+
one *iterable* argument though). It blocks until the result is ready.
16071607

16081608
This method chops the iterable into a number of chunks which it submits to
16091609
the process pool as separate tasks. The (approximate) size of these
@@ -2060,7 +2060,7 @@ Better to inherit than pickle/unpickle
20602060
On Windows many types from :mod:`multiprocessing` need to be picklable so
20612061
that child processes can use them. However, one should generally avoid
20622062
sending shared objects to other processes using pipes or queues. Instead
2063-
you should arrange the program so that a process which need access to a
2063+
you should arrange the program so that a process which needs access to a
20642064
shared resource created elsewhere can inherit it from an ancestor process.
20652065

20662066
Avoid terminating processes
@@ -2139,7 +2139,7 @@ Explicitly pass resources to child processes
21392139
for i in range(10):
21402140
Process(target=f, args=(lock,)).start()
21412141

2142-
Beware replacing sys.stdin with a "file like object"
2142+
Beware of replacing :data:`sys.stdin` with a "file like object"
21432143

21442144
:mod:`multiprocessing` originally unconditionally called::
21452145

@@ -2257,7 +2257,7 @@ Synchronization types like locks, conditions and queues:
22572257

22582258

22592259
An example showing how to use queues to feed tasks to a collection of worker
2260-
process and collect the results:
2260+
processes and collect the results:
22612261

22622262
.. literalinclude:: ../includes/mp_workers.py
22632263

0 commit comments

Comments
 (0)