Only a subset of mypy's test suite should be relevant to typeshed:
https://github.com/python/mypy/pull/9638
This should make things faster.
(Also the -n12 argument to pytest is weird; note mypy's pytest.ini
automatically specificies -nauto which is what we should want)
Resolves https://github.com/python/typeshed/issues/4333
Co-authored-by: hauntsaninja <>
In #4696 I bumped stubtest to a commit that hasn't been released. We
should have these stubtest versions match. In
https://github.com/python/mypy/pull/9426 I changed the output of
stubtest here; it's good to get this change in before I forget and this
action silently stops working.
Co-authored-by: hauntsaninja <>
platform.DEVNULL seemed undocumented, but is eg, still mentioned in the
header comment of platform.py. So feels surprising this was removed
without much warning.
Co-authored-by: hauntsaninja <>
The latest pytype release fixes two pyi parser bugs that allow files
affected by them to be taken off the pytype exclude list. I removed two
`total=False` declarations in tkinter/__init__ that pytype does not like
(because it checks that `total` is present only when TypedDict is a
class's immediate parent) and which shouldn't be needed because
_InMiscNonTotal already specifies totality. I double-checked that mypy
reports no errors in 3.7 on a .py file containing:
from typing_extensions import TypedDict
Foo = TypedDict('Foo', {'x': int}, total=False)
class Bar(Foo): pass
x: Foo = {}
showing that it doesn't require `total` to be repeated.
In tkinter, `widget['foo'] = bar` and `widget.config(foo=bar)` do the same thing, but they will now type-check differently: the `widget['foo'] = bar` syntax allows 'foo' to be any string (e.g. a variable, not necessarily a Literal) and bar to be any object, while `widget.config(foo=bar)` checks the existence of the option and the type of bar. Similarly, cget takes a Literal argument but __getitem__ takes a string.
Testing script can still be found at c42a72c53e
* Removed imported symbols that are not accessed or re-exported from within third_party stubs (part 4). These were all identified as unused symbols by the pyright type checker and language server.
Co-authored-by: Eric Traut <erictr@microsoft.com>
This makes mypy think that conditions like
parameter.kind is Parameter.POSITIONAL_OR_KEYWORD
are always false, which triggers `unreachable` warnings, among other
problems.
This replaces all uses of ‘blacklist’ with ‘exclude list’. Benefits:
- It is racially neutral terminology; see e.g. [1]
- It makes the meaning more clear. In fact, with the popular Python
autoformatter called ‘black’, also used by this project, files can be
‘blackened’ which is something completely different from them being on
a blacklist.
[1] https://chromium.googlesource.com/chromium/src/+/master/styleguide/inclusive_code.md#racially-neutral