* sha3 family of hash functions
* shake variable length hashes that were introduced alongside sha3
* blake2 family of hash functions
* Mark VarLenHash as a private class, since it's not actually exported by hashlib
* Fix typos in my last, and mark hashlib.Hash as a private class since it isn't in the real hashlib
* 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 -.-
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)
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.
CPython _warnings module implementation accepts Warning subclasses and None, but not any subclass of BaseException
specified in the stub. The stub for warnings is correct.
* Fix patch.object to return a _patch context manager.
This should fix https://github.com/python/typeshed/issues/914
* Prefer None over ... to be consistent with the rest of the file.
* Add socket enum classes from py3.4+
Adds four IntEnum classes in the socket module that mirror the
AF_, AI_, MSG_, and SOCK_ sets of constants.
* Update socket AddressInfo/MsgFlag to use IntFlag type
* IntFlag, AddressInfo, and MsgFlag are py 3.6+
* Simplify and add missing types for copy module.
Error and error were missing. I also removed the internal arg memo.
* Move copy module into 2and3
* Bring back internal kwargs