redis-py has introduced an asyncio module since 4.2 and almost all
commands should be async if the redis.asyncio.Redis is used instead of
redis.Redis.
This changes adds the types for all core commands.
Related to #7597
Fixes#7776
Mutating hooks, as in `session.hooks['response'] = ...`, should work. Reassigning it like `session.hooks = ...` is probably a bad idea, so it will always be a `dict`.
Closes#7866. This adds an overload to `asyncio.sleep()`, so that when it is called _without_ `return=None`, the type checker knows that the return type is `None` instead of `unknown`.
Also related to https://github.com/microsoft/pyright/issues/3475.
stubtest_third_party.py will now only print a single line when the test
succeeds for a certain distribution, unless the "-v" option is given.
When the test fails or "-v" is given, will still print the full output.
The success status is now colored to make spotting failures easier.
stdout/stderr is now used consistently: The distribution name and
success status is always printed to stdout, all other output goes to
stderr. Running the script with "2>/dev/null" will only show the success
status of the test, one per line.
Although the specific format of the bytes is opaque and undocumented, the fact that it will be bytes is stable.
This is necessary in order for type checkers to allow creating one code object from another, since the `lnotab`
positional argument to `__init__` is typed as bytes.
Only changes to files in `stdlib` or `stubs` will ever have any effect on the checked open-source code. But also run primer on changes to files in `.github/workflows` so that we can see the effect of changes to the `mypy_primer.yml` file itself.
Use the `| Any` trick instead, since it seems that in a lot of
code the value can be predicted to be non-`None` (if a query
has been executed previously, I think).
The docs don't mention the possibility of this being `None`, so
it seems likely that a lot of code doesn't check for it:
https://docs.python.org/3/library/sqlite3.html#sqlite3.Cursor.description