* 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
None is the default value for these two arguments to logging.Logger._log (which
most other stuff in logging delegates to).
I was getting errors in my codebase because mypy now distinguishes between Any
and Optional[Any].
* move cgi to 2and3 and add types
This is pretty stable between Python 2 and 3, and not very well documented.
* fix CI failures
* adjust comment
(want to force Travis to re-run)
* give up on overriding values
- Add sys.version_info checks (mypy now supports them)
- Went over Python 3 docs and corrected a few things
- Reexport things that are imported from opcode
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.
"> (3,)" works but looks like the code is checking for Python 4.
"<= (3, 5)" was intended to check for versions up to and including 3.5, and probably works that
way in current type checkers. However, sys.version_info is actually a 5-tuple that is greater
than (3, 5), so a hypothetical type checker that uses the full version info would interpret
this check incorrectly.
This ensures that all version_info comparisons use <, >=, ==, or !=.
Both mypy and pytype only use the major and minor version in type checking. Using
checks like "sys.version_info >= (3, 4, 4)" won't actually work properly for
people type checking their code using version 3.4, because (3, 4) >= (3, 4, 4) will
always be false (at least in mypy's approach; not sure if pytype is different).
* Improve types for xml.etree.ElementTree
Update signatures to reflect the following peculiarities of the
ElementTree library:
- The elementtree library accepts unicode or bytes for most xml values
in python2, and coerces everywhere -- but in python3, only str makes
sense.
- In python 2, the library produces str or unicode instances
unpredictably, depending on whether the xml is decodeable as ascii or
not. In python 3, it always produces str instances.
- The parser functions accept unicode or bytes in 2 and 3 -- again, will
coerce individual instances so heterogeneous lists are ok.
- In python 3, the tostring functions produce bytes or str, depending on
the value of the 'encoding' parameter.
* improve docs
* Improve ElementFactory type by specifying dict of 2nd arg