* Define __slots__ for object as Iterable[str] / Iterable[Union[str, unicode]]
* A string as __slots__ value is also valid and represents a single item
Correctly detects calls to `register()` with a function of incompatible return
type. Correctly recognizes the `register()`, `dispatch()`, and
`_clear_cache()` methods on a generic function, as well as the `registry`
mapping.
Possible future improvements: it would be amazing if `register()` checked if
the first argument of the registered callable is indeed of valid type. This
would require Callable[] to support varargs. It would also be great if we
could read the arguments of the remaining arguments during `@singledispatch()`
and cross-check them during `register()` with the currently registered
implementation. Again, this would require Callable[] to become much more
advanced.
```
$ python3.4
Python 3.4.3 (default, Nov 17 2016, 01:08:31)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> list(filter(None, [False, True]))
[True]
>>>
```
* Add `None` to type union for `subprocess.Popen.communicate` stub's `input` parameter.
* subprocess.communicate `input` annotated as `Optional[AnyStr]` for both 2.7 and 3.x; `timeout` as `Optional[float]`.
- Cursor is an Iterator of Any now, and .__iter__(..) and .__next__(..)
have been changed / made explicit to reflect this.
- .fetchall(..)/.fetchmany(..)/.fetchone(..) return (lists of) Anys
instead of tuples.
As per discussion in PR #663, the output of fetching values from the
cursor can be customized with a custom assignment to
.row_factory. Therefore the correct return type for fetching is Any and
not tuple.
Fixes#720.
Related changes: used a NamedTuple for time.struct_time on Python 3, used
sys.version selectors for proper typing of #716, added missing *Style classes
to logging on Python 3.
* 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.