* 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
* Add buffer types to struct module.
I noticed these were missing and I made the version look alike for an easy rename into 2and3.
* Add array to WriteBuffer, add iter_unpack
* Code review comments