From 57e25550bc3e18d3be9ffa84e99ff37271917f1e Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Sun, 10 Apr 2016 20:08:35 -0400 Subject: [PATCH] concurrent.futures: stubgen Imports had to be fixed up manually. --- stdlib/3/concurrent/__init__.pyi | 0 stdlib/3/concurrent/futures/__init__.pyi | 7 ++ stdlib/3/concurrent/futures/_base.pyi | 81 ++++++++++++++++++++++++ stdlib/3/concurrent/futures/process.pyi | 46 ++++++++++++++ stdlib/3/concurrent/futures/thread.pyi | 19 ++++++ 5 files changed, 153 insertions(+) create mode 100644 stdlib/3/concurrent/__init__.pyi create mode 100644 stdlib/3/concurrent/futures/__init__.pyi create mode 100644 stdlib/3/concurrent/futures/_base.pyi create mode 100644 stdlib/3/concurrent/futures/process.pyi create mode 100644 stdlib/3/concurrent/futures/thread.pyi diff --git a/stdlib/3/concurrent/__init__.pyi b/stdlib/3/concurrent/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/stdlib/3/concurrent/futures/__init__.pyi b/stdlib/3/concurrent/futures/__init__.pyi new file mode 100644 index 000000000..91cf274ab --- /dev/null +++ b/stdlib/3/concurrent/futures/__init__.pyi @@ -0,0 +1,7 @@ +# Stubs for concurrent.futures (Python 3.5) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from ._base import * +from .thread import * +from .process import * diff --git a/stdlib/3/concurrent/futures/_base.pyi b/stdlib/3/concurrent/futures/_base.pyi new file mode 100644 index 000000000..19a23e8c6 --- /dev/null +++ b/stdlib/3/concurrent/futures/_base.pyi @@ -0,0 +1,81 @@ +# Stubs for concurrent.futures._base (Python 3.5) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any +from collections import namedtuple + +FIRST_COMPLETED = ... # type: Any +FIRST_EXCEPTION = ... # type: Any +ALL_COMPLETED = ... # type: Any +PENDING = ... # type: Any +RUNNING = ... # type: Any +CANCELLED = ... # type: Any +CANCELLED_AND_NOTIFIED = ... # type: Any +FINISHED = ... # type: Any +LOGGER = ... # type: Any + +class Error(Exception): ... +class CancelledError(Error): ... +class TimeoutError(Error): ... + +class _Waiter: + event = ... # type: Any + finished_futures = ... # type: Any + def __init__(self): ... + def add_result(self, future): ... + def add_exception(self, future): ... + def add_cancelled(self, future): ... + +class _AsCompletedWaiter(_Waiter): + lock = ... # type: Any + def __init__(self): ... + def add_result(self, future): ... + def add_exception(self, future): ... + def add_cancelled(self, future): ... + +class _FirstCompletedWaiter(_Waiter): + def add_result(self, future): ... + def add_exception(self, future): ... + def add_cancelled(self, future): ... + +class _AllCompletedWaiter(_Waiter): + num_pending_calls = ... # type: Any + stop_on_exception = ... # type: Any + lock = ... # type: Any + def __init__(self, num_pending_calls, stop_on_exception): ... + def add_result(self, future): ... + def add_exception(self, future): ... + def add_cancelled(self, future): ... + +class _AcquireFutures: + futures = ... # type: Any + def __init__(self, futures): ... + def __enter__(self): ... + def __exit__(self, *args): ... + +def as_completed(fs, timeout=None): ... + +DoneAndNotDoneFutures = namedtuple('DoneAndNotDoneFutures', 'done not_done') + +def wait(fs, timeout=None, return_when=...): ... + +class Future: + def __init__(self): ... + def cancel(self): ... + def cancelled(self): ... + def running(self): ... + def done(self): ... + def add_done_callback(self, fn): ... + def result(self, timeout=None): ... + def exception(self, timeout=None): ... + def set_running_or_notify_cancel(self): ... + def set_result(self, result): ... + def set_exception(self, exception): ... + +class Executor: + def submit(self, fn, *args, **kwargs): ... + def map(self, fn, *iterables, *, timeout=None, chunksize=1): ... + def shutdown(self, wait=True): ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_val, exc_tb): ... diff --git a/stdlib/3/concurrent/futures/process.pyi b/stdlib/3/concurrent/futures/process.pyi new file mode 100644 index 000000000..605cd80bc --- /dev/null +++ b/stdlib/3/concurrent/futures/process.pyi @@ -0,0 +1,46 @@ +# Stubs for concurrent.futures.process (Python 3.5) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any +from . import _base + +EXTRA_QUEUED_CALLS = ... # type: Any + +class _RemoteTraceback(Exception): + tb = ... # type: Any + def __init__(self, tb): ... + +class _ExceptionWithTraceback: + exc = ... # type: Any + tb = ... # type: Any + def __init__(self, exc, tb): ... + def __reduce__(self): ... + +class _WorkItem: + future = ... # type: Any + fn = ... # type: Any + args = ... # type: Any + kwargs = ... # type: Any + def __init__(self, future, fn, args, kwargs): ... + +class _ResultItem: + work_id = ... # type: Any + exception = ... # type: Any + result = ... # type: Any + def __init__(self, work_id, exception=None, result=None): ... + +class _CallItem: + work_id = ... # type: Any + fn = ... # type: Any + args = ... # type: Any + kwargs = ... # type: Any + def __init__(self, work_id, fn, args, kwargs): ... + +class BrokenProcessPool(RuntimeError): ... + +class ProcessPoolExecutor(_base.Executor): + def __init__(self, max_workers=None): ... + def submit(self, fn, *args, **kwargs): ... + def map(self, fn, *iterables, *, timeout=None, chunksize=1): ... + def shutdown(self, wait=True): ... diff --git a/stdlib/3/concurrent/futures/thread.pyi b/stdlib/3/concurrent/futures/thread.pyi new file mode 100644 index 000000000..f8242ff74 --- /dev/null +++ b/stdlib/3/concurrent/futures/thread.pyi @@ -0,0 +1,19 @@ +# Stubs for concurrent.futures.thread (Python 3.5) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any +from . import _base + +class _WorkItem: + future = ... # type: Any + fn = ... # type: Any + args = ... # type: Any + kwargs = ... # type: Any + def __init__(self, future, fn, args, kwargs): ... + def run(self): ... + +class ThreadPoolExecutor(_base.Executor): + def __init__(self, max_workers=None): ... + def submit(self, fn, *args, **kwargs): ... + def shutdown(self, wait=True): ...