Commit Graph

32 Commits

Author SHA1 Message Date
Jelle Zijlstra
324f1761f4 Change more defaults to ... (#1727) 2017-11-09 10:32:17 -08:00
Jelle Zijlstra
54dd6ba27c Change numerous default values to ... (#1722)
This is the convention, and some default values (e.g. strings) apparently
break pytype.
2017-11-09 06:28:40 -08:00
Alan Du
275d9b5818 Python 3 multiprocesisng synchronization stubs (#1678)
* Add multiprocessing.Array to Python 3 stub

* Add Pipe and Connection type

* Add synchronize type-stub

* Add multiprocessing Exceptions

* Update context with synchronization primitives

* Code review comments

* Add acquire and release from _make_method

* Remove Array stub

* add missing Optional
2017-11-06 23:07:02 -08:00
John Reese
6865c24a4c Add support for multiprocessing.get_context().Process() (#1581) 2017-09-05 20:11:21 -07:00
Daniel Watkins
85a788dbca multiprocessing Pool (and context manager) fixes/improvements (#1562)
* Use typing.ContextManager for multiprocessing context managers

Prior to this commit, the types for __enter__ and __exit__ were not
fully defined; this addresses that.

* Move Pool class stub to multiprocessing.pool

This is where the class is actually defined in the stdlib.

* Ensure that __enter__ on Pool subclasses returns the subclass

This ensures that:

```py
class MyPool(Pool):
    def my_method(self): pass

with MyPool() as pool:
    pool.my_method()
```

type-checks correctly.

* Update the signature of BaseContext.Pool to match Pool.__init__

* Restore multiprocessing.Pool as a function

And also add comments to note that it should have an identical signature
to multiprocessing.context.BaseContext.Pool (because it is just that
method partially applied).
2017-08-28 21:19:08 -07:00
Brian C. Lane
19275ea38a Make multiprocessing.Queue a subclass of queue.Queue (#1525)
Also change multiprocessing.Queue's put and get timeout arguments to
allow None.

This fixes a problem with logging.handlers.QueueHandler and
QueueListener not accepting a multiprocessing.Queue as the queue
argument.

Declaring the Queue now needs to note what it will be used for. eg.
q = multiprocessing.Queue()    # type: multiprocessing.Queue[List[Any]]
2017-08-07 19:25:53 -07:00
eujing
be31439168 Added missing Process fields; More accurate Optional parameters (#1483) 2017-07-18 19:17:23 -07:00
Luka Sterbic
dd7ff91519 Support mp.Value.value (#1480) 2017-07-12 15:00:14 +02:00
khyox
61154a9ad2 Add more multiprocessing function stubs (#1435)
Fixes #1422
2017-06-30 22:25:05 -07:00
Guido van Rossum
350563223f Add Optional[] for all remaining cases of x: <type> = None (#1424)
* Final round of adding Optional[] to type of arguments with default = None
* Update Travis to use --no-implicit-optionals and clarify CONTRIBUTING.md
2017-06-21 10:50:21 -07:00
Luka Sterbic
4a8a20f04e Allow passing lambdas as init arguments in multiprocessing (#1416)
* Use NoReturn in multiprocessing init functions
* Use Any for init functions
2017-06-19 06:45:57 -07:00
Luka Sterbic
0679e0232c Add start, shutdown and context manager methods to BaseManager (#1392) 2017-06-05 14:58:52 -07:00
Luka Sterbic
9601a76b54 Use AsyncResult from multiprocessing.pool (#1317) 2017-05-23 16:33:46 -07:00
Luka Sterbic
9b2b60eafc Make Lock usable as contect manager (#1314) 2017-05-23 15:00:32 -07:00
John Reese
54408054cc Add type stubs for multiprocessing.Manager() (#1270)
* Use Dict/List types and _Namespace alias

* Use TypeVar definitions for mapping/sequence stubs
2017-05-22 15:31:23 -07:00
Jelle Zijlstra
728b977729 Replace a number of default argument values with "..." (#1280)
pytype apparently doesn't like default values that aren't ints or
None/True/False.
2017-05-21 14:31:22 -07:00
Mahmoud Afaneh
3896298027 Add multiprocessing.context stubs (#1260) 2017-05-20 23:13:18 -07:00
Mahmoud Afaneh
30283aa670 Adds Event stub to multiprocessing (#1247)
* Adds Event type to multiprocessing

* Add event and context stub to multiprocessing stub.  Updates per recommendations.

* Adding missing newline at EOF.

* Stubbing just BaseContext and not any of the member functions.

* Fix flake8 extra line.

* Fix comment.

* Add todo for BaseContext, make ctx of Any type, and remove multiprocessing.context
2017-05-10 07:20:19 -07:00
Lukasz Langa
5f416fae64 Add missing List imports. 2016-12-21 01:06:52 -08:00
Lukasz Langa
6e2709906b Fixing flake8 B errors 2016-12-20 01:17:38 -08:00
Daisuke Miyakawa
b33c2c6158 Introduce multiprocessing.freeze_support() (#749) 2016-12-07 13:30:14 -08:00
Ryan C. Thompson
f36d7a3cd3 Multiprocessing fixes (#687)
* Fix type declarations for multiprocessing.pool.ThreadPool

The existing incomplete type declarations were replaced by a copy of
multiprocessing.Pool's declarations, suitably modified.

Fixes #683.

* Change iterable type to Iterable[Iterable[Any]] in starmap

multiprocessing.Pool and multiprocessing.pool.ThreadPool have starmap
and related methods, where the iterable argument is expected to yield
iterables. The type declarations now reflect this.
2016-11-12 17:31:54 -08:00
Elazar Gershuni
252a772b67 fix self in ssl, unittest and multiprocessing/managers (#644) 2016-10-30 12:20:03 -07:00
Dima Gerasimov
58d864d726 Add __enter__ and __exit__ to Pool stub (#642) 2016-10-30 10:18:51 -07:00
Alex Jurkiewicz
8d10e885d1 [review] Add multiprocessing.Pool (#523) 2016-10-12 16:44:37 -07:00
Valérian Rousset
231ebbefaa add types to multiprocessing.process (#463) 2016-08-10 11:01:54 -07:00
David Euresti
141318c056 Add RemoteError and current_process to multiprocessing (#445) 2016-08-05 07:19:46 -07:00
Max Payton
a619491060 Add full class definitions for Process, Queue, and Lock (#265)
These should be all the methods one can call on those classes
2016-06-04 18:31:48 -07:00
Yasushi Saito
7389610937 Added type declaration for multiprocessing.pool.ThreadPool and AsyncResult. (#143) 2016-04-12 14:42:15 -07:00
Anirudha Bose
09eeeea9f7 Add stub for multiprocessing.cpu_count() 2016-03-05 05:17:04 +05:30
Matthias Kramm
94c9ce8fd0 Consistently use '= ...' for optional parameters. 2015-11-09 13:55:02 -08:00
Matthias Kramm
337abed05a add (overwrite with) mypy stubs, if available 2015-09-30 09:59:44 -07:00