* Change Uses of List[] to Sequence[] in argument positions.
One of these (parse_args()) broke in real-world code, because the
expected type was List[Union[str, bytes]] but the actual type was
List[str] (because List is invariant). That is ridiculous, so I
changed the accepted type to Sequence[_Text] which is covariant. Then
I found a few other methods/functions that probably should also be
changed to Sequence, but I'm less certain of those. I'm not at all
sure about the instance/class attributes, so I left those alone
(though I suspect those might also have to switch).
* Fixes suggested by code review
- Changed Sequence[Option] to Iterable[Option] everywhere
- Changed _process_args to plain List
* Partial lib2to3 stubs
* Use typing.Text instead of str
* Add a _Path shortcut for managing PathLike
* Respond to review, pgen2/driver
* Respond to review, pgen2/grammar
* Respond to review, pgen2/parse
* Respond to review, pgen2/pgen
* Respond to review, pgen2/token
* Respond to review, pgen2/tokenize
* Respond to review, pytree
* Move to 2and3
* Make pytype happy
* Respond to review nits
* Move _RawNode, _Convert to pytree and make the latter return None
* Make concrete Symbols subclasses for python and pattern
* Add missing Callable import
mypy could not recognize the case when we use contextmanager as a
decorator, which has been supported since Python 3.2.
In the following code snippet,
from contextlib import contextmanager
@contextmanager
def foo(arg1):
try:
print(arg1)
print('1')
yield
finally:
print('2')
@foo('0')
def foo2():
print('3')
foo2()
we get mypy error as follows,
error: ContextManager[Any] not callable
The suggested changes can fix this error and properly reflect the
updated contextmanager usage pattern.
* 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