* Allow None in concurrent.futures.exception() and set_exception()
* Make Executor.map() signature more precise
* Remove superfluous signatures
* Specify str type for some concurrent.futures constants
* Update concurrent.futures backport
* CR fixes
* 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
From Samuel Freilich:
In Python 2, the predicate parameter in itertools.ifilter and
itertools.ifilterfalse can be None, indicating that true or false values
should be retained (functionally equivalent to passing "bool" as the
predicate). In Python 3, filter and itertools.filterfalse have
the same behavior.
* add typing.ContextManager for 3.6+ only
This fixes the easier part of #655.
Would it make sense to add a generic typing.ContextManager that exists in any Python version?
* update comment
* fix argument types for ContextManager.__exit__
* add AsyncContextManager
* add @asynccontextmanager
* typing.ContextManager now always exists
* back out async-related changes
Will submit those in a separate PR later
* fix import order
* AbstractContextManager only exists in 3.6+
* AbstractContextManager -> ContextManager
* Update pbkdf2_hmac for Python 3.5
- Use `iterations` instead of `rounds` if running on 3.5
- Change `dklen` to `Optional`
* Use `iterations` instead of `rounds` in 3.4+
* Updated the typehints for itertools.
* Removed the overload because it caused problems and cleaned up the imports.
* Update itertools.pyi
Added back optionality of second argument for itertools.permutations.
* Update itertools.pyi
Moved the Optional which I accidentially put on the wrong function -.-
The previous change was still right. Unique among `poplib` functions, `uidl()` returns a long response when called without arguments, but just a bytes string when called with a `which` argument.
Put this in stdlib/3 because it changed pretty radically in 3.2. We might be
able to move it to 2and3 later, but I want to focus on completing the Python 3
standard library first.
* Fix incorrect usage of AnyStr
- sqlite3 was using Union[bytes, AnyStr], which doesn't make sense
- The urllib functions I changed accept either bytes or str for their "safe"
argument
- Also added supports for PathLike to pstats
- Remove some unused imports of AnyStr
* pstats: python 2 accepts unicode
* improve stubs for _codecs
I noticed that many of these used AnyStr in a context where it doesn't make
sense. Found a few more things after reviewing _codecsmodule.c:
- Some Windows-only functions were omitted
- A few argument counts and names and return types were wrong
The Python 2 _codecs stub has many of the same issues, but the module is also
pretty similar between Python 2 and 3. I'm planning to send another PR after this
one to merge the two and move the stub into 2and3.
* correct platform name
Fixespython/mypy#3247
Also reviewed some related logic:
- __mod__ was added to both bytes and bytearray with PEP 461, which went into 3.5
- str.__mod__ takes only one argument, and the signature calls it "value"
- In Python 2, bytearray doesn't have __mod__ (and typeshed correctly omits it)
* Add pyi for pydoc [Python 2.7]
* Fixed issues
* A few more fixes
- `synopsis -> Optional[AnyStr]`
- `visiblename` takes a `Container`
- `getdoc -> Union...` not `AnyStr`
* `synopsis` and `source_synopsis`
This is the other half of fixing #1115.
Also fixed the stub for JSONDecodeError and made it only exist in 3.5+.
Didn't otherwise review the exact attributes and types in the package.