Skip to content

Conversation

ankith26
Copy link
Member

@ankith26 ankith26 commented Oct 6, 2025

ByteString is deprecated and scheduled for removal in python 3.17

https://docs.python.org/3.14/whatsnew/3.14.html#pending-removal-in-python-3-17

@ankith26 ankith26 requested a review from a team as a code owner October 6, 2025 08:23
Copy link
Contributor

coderabbitai bot commented Oct 6, 2025

📝 Walkthrough

Walkthrough

Updated pygame scrap stub: adjusted imports to use typing_extensions for Buffer and deprecated; changed put() parameter type from ByteString to Buffer. No runtime logic changes; only type annotations and import restructure within the stub file.

Changes

Cohort / File(s) Summary of Changes
Stub typing updates
buildconfig/stubs/pygame/scrap.pyi
Switched to grouped import from typing_extensions including Buffer and deprecated; updated put(data_type: str, data: Buffer, /) -> None (was ByteString).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly identifies the core change—removing the deprecated ByteString usage—and aligns directly with the updated function signature and imports in the stub file. It is concise, clear, and specific enough for reviewers to understand the primary intent without extraneous detail.
Description Check ✅ Passed The description clearly explains that ByteString is deprecated and scheduled for removal in Python 3.17 and includes a relevant link to the official documentation, directly supporting the change made in the pull request.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ankith26-deprecated-bytestring

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f17f602 and 44e97c5.

📒 Files selected for processing (1)
  • buildconfig/stubs/pygame/scrap.pyi (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (19)
  • GitHub Check: debug_coverage (ubuntu-24.04, 3.9.23)
  • GitHub Check: debug_coverage (ubuntu-24.04, 3.14.0rc1)
  • GitHub Check: debug_coverage (ubuntu-24.04, 3.13.5)
  • GitHub Check: x86
  • GitHub Check: AMD64
  • GitHub Check: build (ubuntu-22.04)
  • GitHub Check: Debian (Bookworm - 12) [ppc64le]
  • GitHub Check: Debian (Bookworm - 12) [armv7]
  • GitHub Check: Debian (Bookworm - 12) [armv6]
  • GitHub Check: Debian (Bookworm - 12) [s390x]
  • GitHub Check: build (macos-14)
  • GitHub Check: x86_64
  • GitHub Check: aarch64
  • GitHub Check: msys2 (ucrt64, ucrt-x86_64)
  • GitHub Check: build (ubuntu-24.04)
  • GitHub Check: msys2 (clang64, clang-x86_64)
  • GitHub Check: msys2 (mingw64, x86_64)
  • GitHub Check: i686
  • GitHub Check: dev-check
🔇 Additional comments (2)
buildconfig/stubs/pygame/scrap.pyi (2)

3-6: LGTM! Correct replacement for deprecated ByteString.

The import of Buffer from typing_extensions is the appropriate replacement for the deprecated ByteString. The comments documenting when each type was added to Python are helpful for understanding compatibility.


17-17: <!-- [scratchpad]
[task review_file_1/1 review_segment_2/2]
[observations]

  • No occurrences of ByteString found in .py or .pyi files per search.
  • Stub updated to use Buffer, matching Python 3.17 deprecation guidance.
  • Actual pygame.scrap.put() implementation lies outside this repo.
    [analysis]
  • Codebase no longer references ByteString.
  • Cannot verify C-level implementation supports full buffer protocol here.
    [pending]
  • Manual confirmation that underlying put() handles arbitrary buffer protocol objects.
    [done]
    Search for ByteString complete; ready to finalize comment.
    [/scratchpad]

LGTM – stub update aligns with Python 3.17 deprecation
No remaining ByteString references found. Manually confirm that the underlying put() implementation accepts all buffer-protocol objects.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Member

@oddbookworm oddbookworm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@damusss damusss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

@damusss damusss merged commit 963fef1 into main Oct 7, 2025
28 checks passed
@ankith26 ankith26 deleted the ankith26-deprecated-bytestring branch October 7, 2025 16:04
@ankith26 ankith26 added this to the 2.5.6 milestone Oct 7, 2025
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.

3 participants