GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GH-132983: Remove subclassing support from zstd types by AA-Turner · Pull Request #133694 · python/cpython

Conversation

@AA-Turner

@AA-Turner AA-Turner commented May 8, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

cc @Rogdham

For what it's worth, bz2 and lzma's decompressor subclassing fail on creation:

>>> import bz2
>>> class D(bz2.BZ2Decompressor): pass
... 
Traceback (most recent call last):
  File "<python-input-18>", line 1, in <module>
    class D(bz2.BZ2Decompressor): pass
TypeError: type '_bz2.BZ2Decompressor' is not an acceptable base type

>>> import lzma
>>> class D(lzma.LZMADecompressor): pass
... 
Traceback (most recent call last):
  File "<python-input-19>", line 1, in <module>
    class D(lzma.LZMADecompressor): pass
TypeError: type '_lzma.LZMADecompressor' is not an acceptable base type
  • Issue: Implement PEP 784 - Adding Zstandard to the Python standard library #132983

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@AA-Turner
Remove subclassing support from zstd types
e0bd70d
@AA-Turner
AA-Turner requested review from emmatyping and picnixz May 8, 2025 18:09
@AA-Turner AA-Turner added the skip news label May 8, 2025
@bedevere-app bedevere-app Bot mentioned this pull request May 8, 2025
Implement PEP 784 - Adding Zstandard to the Python standard library #132983
Closed
13 tasks done
@bedevere-app bedevere-app Bot added the awaiting core review label May 8, 2025
Rogdham
Rogdham approved these changes May 8, 2025
View reviewed changes

@Rogdham Rogdham left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM, I also confirmed it works as intended.

I just noticed the case difference between zstdcompressor_type_spec and ZstdDecompressor_type_spec (and same for …_slots), but maybe it's for an other PR?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@AA-Turner

AA-Turner commented May 8, 2025

Copy link
Copy Markdown
Member Author

See #133674, which does the rename.

Rogdham reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AA-Turner
AA-Turner enabled auto-merge (squash) May 8, 2025 18:24
@AA-Turner
AA-Turner merged commit bd7c585 into python:main May 8, 2025
@bedevere-app bedevere-app Bot removed the awaiting core review label May 8, 2025
@AA-Turner AA-Turner added the needs backport to 3.14 bugs and security fixes label May 9, 2025
@miss-islington-app

miss-islington-app Bot commented May 9, 2025

Copy link
Copy Markdown

Thanks @AA-Turner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 9, 2025
@AA-Turner @miss-islington
pythonGH-132983: Remove subclassing support from zstd types (pythonGH…
59a59e2
…-133694)

For consistency with ``bz2``, ``lzma``, and ``zlib``.
(cherry picked from commit bd7c585)

Co-authored-by: Adam Turner <[email protected]>
@bedevere-app

bedevere-app Bot commented May 9, 2025

Copy link
Copy Markdown

GH-133762 is a backport of this pull request to the 3.14 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label May 9, 2025
AA-Turner added a commit that referenced this pull request May 9, 2025
@miss-islington @AA-Turner
[3.14] GH-132983: Remove subclassing support from zstd types (GH-133694…
5dddedf
…) (#133762)

GH-132983: Remove subclassing support from zstd types (GH-133694)

For consistency with ``bz2``, ``lzma``, and ``zlib``.
(cherry picked from commit bd7c585)

Co-authored-by: Adam Turner <[email protected]>
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
@AA-Turner @Pranjal095
pythonGH-132983: Remove subclassing support from zstd types (python#1…
b07fbb0
…33694)

For consistency with ``bz2``, ``lzma``, and ``zlib``.
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
@AA-Turner @taegyunkim
pythonGH-132983: Remove subclassing support from zstd types (python#1…
dc93f17
…33694)

For consistency with ``bz2``, ``lzma``, and ``zlib``.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@emmatyping emmatyping Awaiting requested review from emmatyping emmatyping is a code owner
@picnixz picnixz Awaiting requested review from picnixz
1 more reviewer
@Rogdham Rogdham Rogdham approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@AA-Turner @Rogdham
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.