Skip to content

Broaden receive data buffer types#1315

Open
Harshal96 wants to merge 1 commit intopython-hyper:masterfrom
Harshal96:feat/strict-bytes-buffer-types
Open

Broaden receive data buffer types#1315
Harshal96 wants to merge 1 commit intopython-hyper:masterfrom
Harshal96:feat/strict-bytes-buffer-types

Conversation

@Harshal96
Copy link
Copy Markdown

@Harshal96 Harshal96 commented May 10, 2026

Summary

  • Broaden H2Connection.receive_data and FrameBuffer.add_data annotations from bytes to a local PEP 688-style Buffer protocol.
  • Normalize frame buffer input through memoryview so byte-like inputs are handled consistently.
  • Add a strict-bytes mypy fixture covering bytearray and memoryview, and run it in the lint tox environment.

Fixes #1305.

Validation

Local CI-equivalent checks run before advancing this draft:

  • uv run --no-project --with tox --with tox-gh-actions tox -e py311
  • uv run --no-project --with tox --with tox-gh-actions tox -e lint
  • uv run --no-project --with tox --with tox-gh-actions tox -e py310,py312,py313,py314,packaging
  • uv run --python 3.13 --no-project --with tox --with tox-gh-actions tox -r -e docs

Upstream GitHub Actions note: the PR's CI workflow is currently action_required with no jobs, so it has not executed on GitHub yet. The remaining h2spec job is Linux-specific in the workflow because it downloads a Linux h2spec binary, so I could not reproduce that exact job on this macOS workspace.

@Harshal96 Harshal96 force-pushed the feat/strict-bytes-buffer-types branch from 0eae096 to 46d91d5 Compare May 10, 2026 08:12
@Harshal96 Harshal96 marked this pull request as ready for review May 10, 2026 08:14
@Harshal96 Harshal96 changed the title [codex] Broaden receive data buffer types Broaden receive data buffer types May 10, 2026
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.

Update types to adhere to --strict-bytes / PEP688

1 participant