* Improve types for CalledProcessError
This adds union types in the constructor to account for parameters that
might be either byte strings or unicode strings. At the same time, this
*removes* specific types from the user-accessible fields, to avoid the
need for users to at every use site specify which types their particular
instance was instantiated with.
* remove 'moral' comments; add List import; change 'str' to 'Text'
* import Text
* List -> Sequence; reinsert 'moral' comments
* Regularize string types everywhere
This defines _TXT and _CMD aliases, and uses them everywhere applicable.
Also brings the _FILE alias to python3.
* fix typo; possibly fix indentation
* remove trailing comma, which caused problems in python 2 tests
* fix py2 outputs to be bytes; tweak descriptive comments; remove one AnyStr
This declares the method to take the union of Set and FrozenSet
rather than AbstractSet since that is where `difference()`
(used by `assertSetEqual()`) is defined.
Using izip with up to 6 arguments will retain the arguments' type information,
using izip with 7 and more arguments will discard type information about the
generated tuple items.
Also fix signature of IO.seek, IO.truncate, IO.write, and MutableMapping.update
Fixes#1016
Note: I couldn't put typing.pyi in 2and3 because of an import cycle when adding `import sys` to 2/typing.pyi
* add compileall stubs to 3 and add types to the ones in 2
Didn't merge the stubs because all functions have additional parameters since 3.2,
so there would be no shared code between 2 and 3.
* add comment
CONTRIBUTING.md says to prefer ... Not the most impactful change but fixing
these will allow us to lint for it in the future and get a consistent style.
Fixes#975
And a few more things I noticed while reading the tempfile docs.
In 3.5, most functions in tempfile were changed to accept either str or bytes in their prefix and suffix arguments, and return bytes or str accordingly. This seemed like a case for AnyStr.
We were missing tempdirb and tempprefixb, added in 3.5.
TemporaryFile and others were declared as returning BinaryIO, but they actually return either binary or text IO depending on the mode passed in. I changed the return type to IO[Any], similar to builtins.open.
* Make pickle accept IO[str] instead of BinaryIO.
This makes the following code work:
pickle.Unpickler(cStringIO.StringIO())
(Which didn't work before because cStringIO.StringIO inherits "only"
from IO[str], not BinaryIO)
* Use bytes instead of str.