From 40a8b136e90edb43d7441365fa8527975494d7cb Mon Sep 17 00:00:00 2001 From: vuyua9 <157298474@qq.com> Date: Sun, 24 May 2026 23:18:22 +0800 Subject: [PATCH 1/2] docs: fix subscription response field path --- docs/subscriptions.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/subscriptions.rst b/docs/subscriptions.rst index 85a4f303cf..2dd4b23b6c 100644 --- a/docs/subscriptions.rst +++ b/docs/subscriptions.rst @@ -33,7 +33,8 @@ When you subscribe to an event – new block headers, for example – you'll rec print(response) # unsubscribe: - if response["number"] > 42012345: + new_head = response["result"] + if new_head["number"] > 42012345: await w3.eth.unsubscribe(subscription_id) break From 7651fb32b0d2e0943606aebf7017f259462598e5 Mon Sep 17 00:00:00 2001 From: vuyua9 <157298474@qq.com> Date: Sun, 24 May 2026 23:20:59 +0800 Subject: [PATCH 2/2] docs: add subscription example newsfragment --- newsfragments/3850.docs.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 newsfragments/3850.docs.rst diff --git a/newsfragments/3850.docs.rst b/newsfragments/3850.docs.rst new file mode 100644 index 0000000000..46ef71fc5b --- /dev/null +++ b/newsfragments/3850.docs.rst @@ -0,0 +1 @@ +Fix the introductory subscription example to read the block number from the formatted subscription response result.