If no arguments are passed to the TemporaryDirectory constructor, then
the class defaults to using str. Overload the __init__ function to
cover this case.
I just found and fixed a bug in pyright's "missing type arguments" check. When type arguments were omitted for a generic type within a subscript expression, the error was being suppressed. With this bug fixed, I found several new cases where type arguments were missing in stdlib stubs. (#5130)
Co-authored-by: Eric Traut <erictr@microsoft.com>
The turtle module re-exports methods of its classes as top-level functions.
Typeshed includes most of these, but `exitonclick` and others from the
`_Screen` class were missing.
Add them.
Co-authored-by: Petr Viktorin <encukou@gmail.com>
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
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 <>