Skip to content

fix: remove spurious pass statement in signature_delta handler#1255

Open
frankgoldfish wants to merge 1 commit intoanthropics:mainfrom
frankgoldfish:fix/remove-spurious-pass-in-signature-delta
Open

fix: remove spurious pass statement in signature_delta handler#1255
frankgoldfish wants to merge 1 commit intoanthropics:mainfrom
frankgoldfish:fix/remove-spurious-pass-in-signature-delta

Conversation

@frankgoldfish
Copy link

Summary

In _messages.py and _beta_messages.py, the elif event.delta.type == "signature_delta": branch in build_events() contains a spurious pass statement after the if content_block.type == "thinking": block. This pass is unreachable dead code that adds confusion about the control flow — it appears as though the else branch below is the fallthrough of the pass, when in reality it's the fallthrough of the entire elif.

Changes

  • src/anthropic/lib/streaming/_messages.py: Removed pass from signature_delta handler
  • src/anthropic/lib/streaming/_beta_messages.py: Removed pass from signature_delta handler

Test plan

  • Verify that streaming with extended thinking still correctly fires SignatureEvent for signature_delta events
  • Verify no change in behavior — this is purely dead code removal

🤖 Generated with Claude Code

In build_events(), the 'elif event.delta.type == "signature_delta":' branch
contained an unnecessary pass statement after the inner if-block. Because
the elif branch already has real code (the inner if), the pass was dead code
that served no purpose and misleadingly implied an intentional empty path.

Removes the same pattern from both _messages.py and _beta_messages.py.
@frankgoldfish frankgoldfish requested a review from a team as a code owner March 18, 2026 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant