Skip to content

fix: narrow Stream.flow() return type from Collection to Sequence/list#118

Merged
eywalker merged 1 commit intodevfrom
kurodo/plt-1179-fix-stream-flow-return-type-hint
Mar 28, 2026
Merged

fix: narrow Stream.flow() return type from Collection to Sequence/list#118
eywalker merged 1 commit intodevfrom
kurodo/plt-1179-fix-stream-flow-return-type-hint

Conversation

@kurodo3
Copy link
Copy Markdown
Contributor

@kurodo3 kurodo3 Bot commented Mar 27, 2026

Summary

  • Protocol (StreamProtocol.flow) return type narrowed from Collection[tuple[...]] to Sequence[tuple[TagProtocol, PacketProtocol]] — callers using only the protocol can assume ordered, indexable access but not a specific concrete type
  • Concrete implementation (StreamBase.flow) narrowed further to list[tuple[TagProtocol, PacketProtocol]] — accurately reflects that the method returns a list comprehension
  • Added Sequence to collections.abc imports in both affected files; Collection retained for other usages

Closes PLT-1179

Test plan

  • All existing tests pass (2584 passed, 49 skipped on dev branch)
  • No new failures introduced — pre-existing failures in test_hashing/test_store dirs are unrelated

🤖 Generated with Claude Code

Protocol declares Sequence[tuple[TagProtocol, PacketProtocol]] to
accurately reflect ordered, indexable semantics without over-constraining
implementations. The concrete StreamBase implementation narrows further
to list[tuple[TagProtocol, PacketProtocol]] since it returns a list
comprehension.

Closes PLT-1179

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@eywalker eywalker merged commit 5f7ebed into dev Mar 28, 2026
8 checks passed
@eywalker eywalker deleted the kurodo/plt-1179-fix-stream-flow-return-type-hint branch March 28, 2026 00:53
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