fix: remove spurious pass statement in signature_delta handler#1255
Open
frankgoldfish wants to merge 1 commit intoanthropics:mainfrom
Open
fix: remove spurious pass statement in signature_delta handler#1255frankgoldfish wants to merge 1 commit intoanthropics:mainfrom
frankgoldfish wants to merge 1 commit intoanthropics:mainfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In
_messages.pyand_beta_messages.py, theelif event.delta.type == "signature_delta":branch inbuild_events()contains a spuriouspassstatement after theif content_block.type == "thinking":block. Thispassis unreachable dead code that adds confusion about the control flow — it appears as though theelsebranch below is the fallthrough of thepass, when in reality it's the fallthrough of the entireelif.Changes
src/anthropic/lib/streaming/_messages.py: Removedpassfromsignature_deltahandlersrc/anthropic/lib/streaming/_beta_messages.py: Removedpassfromsignature_deltahandlerTest plan
SignatureEventforsignature_deltaevents🤖 Generated with Claude Code