Update pyright CI test to use the latest version of pyright (1.1.118). Enable all but one of pyright's strictest checks. Add a "# type: ignore" to `__new__` method in `weakref.KeyRef` because it uses a non-standard name for the `cls` parameter, which is flagged as an error by pyright.
Co-authored-by: Eric Traut <erictr@microsoft.com>
Run the mypy test suite using Ubuntu 18.04. Ubuntu 20.04 doesn't have a package for virtualenv on Python 2.
Also, curses.color_pair() now has a named argument.
Eliminated the use of "bare" TypeVars (i.e. a TypeVar that appears only once) within generic methods. While not considered an error in PEP 484, these are a common source of bugs in code, and some type checkers (including pytype and pyright) flag them as errors.
Co-authored-by: Eric Traut <erictr@microsoft.com>
* Split cgi.pyi into Py2 and 3 versions
* Restore correct Python 2 version of cgi.pyi
* Remove unnecessary version checks in cgi.pyi
* Use collections.abc
* Use List in Python 2 stub
A security fix added a "separator" argument to several URL parsing
functions and method in point releases:
* 3.6.13
* 3.7.10
* 3.8.8
* 3.9.2
Until all these versions are available on the GitHub Actions runners,
we need to whitelist the functions in the stubtests.
* Remove conventions enforced by black
Remove old note about optional default arguments (now part of
PEP 484 and enforced by CI)
* Recommend to use PEP 585
Cf. #4820
* Try out using collections.abc
* Reference mypy bug
Added a # type: ignore comment to the `timeout` property setter in filelock to suppress errors about type mismatch between setter and getter.
Co-authored-by: Eric Traut <erictr@microsoft.com>
This is enough to get stubtest working (note that it's a little annoying
to install mypy currently since typed-ast seems to have broken again on
Python 3.10)
Co-authored-by: hauntsaninja <>
The TypeVar `_T` was being used as a type argument for `PathLike`, but `PathLike` requires that its type argument be constrained to `str` or `bytes`, and `_T` didn't provide any such constraint. The easy workaround is to use the TypeVar `AnyStr` instead.
Co-authored-by: Eric Traut <erictr@microsoft.com>
Fixed a problem with the openssl-python stubs. It was using `unicode`, which is not defined in Python 3. I conditionalized its use based on Python version check.
Co-authored-by: Eric Traut <erictr@microsoft.com>