Sourced from redis's releases.
8.0.0
Changes
🚀 Highlights
Async Cluster PubSub
This release introduces full asyncio Cluster PubSub support, bringing shard-channel capabilities (
SSUBSCRIBE,SUNSUBSCRIBE,SPUBLISH) to the asyncRedisClusterclient. The newClusterPubSubclass inredis.asyncio.clusterautomatically routes shard-channel subscriptions to the correct cluster node based on key-slot hashing, manages per-node PubSub connections, and supports round-robin message retrieval across nodes. Users can create a cluster pubsub instance viaRedisCluster.pubsub()and usessubscribe(),sunsubscribe(), andget_sharded_message()just as they would with the sync cluster client.Keyspace and subkey notifications
Redis Keyspace Notifications are now supported for standalone and cluster deployments in both sync and async modes. New classes —
KeyspaceNotifications,ClusterKeyspaceNotifications,AsyncKeyspaceNotifications, andAsyncClusterKeyspaceNotifications— provide a high-level API for keyspace/keyevent subscriptions and subkey notification families:subkeyspace,subkeyevent,subkeyspaceitem, andsubkeyspaceevent. Convenience methods likesubscribe_keyspace(),subscribe_keyevent(),subscribe_subkeyspace(),subscribe_subkeyevent(),subscribe_subkeyspaceitem(), andsubscribe_subkeyspaceevent()simplify common patterns, with channel classes for both key and subkey channels.In cluster mode, subscriptions are managed across primary nodes because each node emits notifications only for keys it owns, with built-in topology-change handling. Sync
run_in_thread()and asynclisten()workflows are supported.Redis Array commands(https://redis.io/docs/latest/develop/data-types/arrays/)
redis-py now supports Redis Arrays, a preview Redis data type for sparse, index-addressable sequences of strings. New
AR*command helpers cover indexed reads/writes, range scans, deletion, cursor-based insertion, ring-buffer writes, metadata, text search, and aggregation, includingARGET,ARSET,ARMGET,ARMSET,ARSCAN,ARGREP,ARRING, andAROP.Type Hints Improvements (breaking changes)
The
@overloadpattern has been applied systematically across core commands (core.py), VectorSet commands, and module commands (Search, JSON, TimeSeries, Bloom filters) to provide distinct return types for sync and async clients. Previously, methods returned a combinedResponseT(i.e.,Union[Awaitable[Any], Any]), which caused static analysis tools like mypy and Pyright to flag false positives. Now, sync clients see concrete return types (e.g.,int,bool,list[str]) while async clients seeAwaitable[...]wrappers. This is a breaking change for type-checking only—runtime behavior is unchanged, but code relying on the old union return types in type annotations may need updates. Two new protocol types,SyncClientProtocolandAsyncClientProtocol, are used in overload signatures to enable this distinction.RESP3 by default with opt-in unified responses
redis-py 8.0.0 now uses RESP3 on the wire by default while preserving legacy RESP2-compatible Python response shapes for existing applications (#4052). Protocol-independent unified response shapes are available by setting
legacy_responses=False, so affected commands return the same Python structure with RESP2 or RESP3.Use
protocol=2to force RESP2 on the wire,protocol=3to opt into native RESP3 response shapes, orlegacy_responses=Falseto migrate to unified responses. Seehttps://github.com/redis/redis-py/blob/HEAD/docs/unified_responses.rstandhttps://github.com/redis/redis-py/blob/HEAD/specs/unified_responses_migration_guide.mdfor the affected commands and migration details.Connection and retry defaults
Default connection settings were updated:
socket_timeoutandsocket_connect_timeoutnow default to 5 seconds, TCP keepalive is enabled by default, socket reads use a 32 KB buffer, connection pools default tomax_connections=100, and retry defaults now use 10 attempts with exponential jitter backoff.Note:
socket_timeoutcan affect blocking commands such asBLPOP/BRPOP; if a command blocks longer than the client socket timeout, it may raiseTimeoutErrorbefore the command timeout elapses (#2807).🧪 Experimental Features
- Added support for new array commands (#4055)
🚀 New Features
- Support Cluster PubSub in asyncio (#3736)
- Add Redis Keyspace Notifications Support for Redis Cluster (#3962)
- Add random load balancing strategy which allows for use of the primary (#4027)
- Add FPHA (floating-point homogeneous array) arg support to JSON.SET (#4011)
- Added custom Claude command + XNACK command support (#4030)
- Adding Time Series Multiple Aggregators support (#4035)
- Adding support for new COUNT aggregator for some sorted set commands - ZINTER, ZINTERSTORE, ZUNION, ZUNIONSTORE (#4034)
- Adding support for new INCREX command (#4067 #4077)
- Add support for PubSub subscriptions with binary channel names and handlers (#4068)
... (truncated)
733f80e
Updates in default connection and retry settings (#4082)a68a16c
Updating Redis supported versions in README.md and lib version to
8.0.043a41d3
Updating INCREX command arg - SATURATE now controls overflow behaviour
(#4077)1496deb
Preserve explicit None for client metadata config (#4081)57dc08c
Avoid zero-timeout async reads in hiredis connections readiness checks
and re...cd54ddd
fix(typing): correct type annotation for XReadResponse (#4046)ab2d41f
Add support for PubSub subscriptions with binary channel names and
handlers (...ef24dc9
Randomize cluster startup node order during topology refresh (#4060)b604015
Add CLAUDE.md and /sync-claude-md skill for managing (#4066)2b8b4fc
Fix flaky tests (#4071)Sourced from mypy's changelog.
Mypy Release Notes
Next Release
Mypy 2.1
We’ve just uploaded mypy 2.1.0 to the Python Package Index (PyPI). Mypy is a static type checker for Python. This release includes new features, performance improvements and bug fixes. You can install it as follows:
python3 -m pip install -U mypyYou can read the full documentation for this release on Read the Docs.
librt.vecs: Fast Growable Array Type for Mypyc
The new
librt.vecsmodule provides an efficient growable array typevecthat is optimized for mypyc use. It provides fast, packed arrays with integer and floating point value types, which can be several times faster thanlist, and tens of times faster thanarray.arrayin code compiled using mypyc. It also supports nestedvecobjects and non-value-type items, such asvec[vec[str]].Refer to the documentation for the details.
Contributed by Jukka Lehtosalo.
librt.random: Fast Pseudo-Random Number Generation
The new
librt.randommodule provides fast pseudo-random number generation that is optimized for code compiled using mypyc. It can be 3x to 10x faster than the stdlibrandommodule in compiled code.Refer to the documentation for the details.
Contributed by Jukka Lehtosalo (PR 21433).
Mypyc Improvements
- Enable incremental self-compilation (Vaggelis Danias, PR 21369)
- Make compilation order with multiple files consistent (Piotr Sawicki, PR 21419)
- Fix crash on accessing
StopAsyncIteration(Piotr Sawicki, PR 21406)- Fix incremental compilation with
separateflag (Vaggelis Danias, PR 21299)Fixes to Crashes
... (truncated)
c1c336d
Remove +dev from version74df14b
Add changelog for mypy 2.1 (#21464)022d9bc
Revert "TypeForm: Enable by default (#21262)"8826288
[mypyc] Document librt.random (#21463)3f4067b
Bump librt version to 0.11.0 (#21458)2b1eb58
[mypyc] Enable incremental self-compilation (#21369)8152f4a
Respect file config comments for stale modules (#21444)116d60b
Fix nondeterminism from nonassociativity of overload joins (#21455)6c4af8e
Fix function call message change for small number of args (#21432)4b8fdca
[mypyc] Add librt.random module (#21433)