WebSafe 3.7github.com
|
|
🏠
Skip to content

GH-132983: Remove subclassing support from zstd types#133694

Merged
AA-Turner merged 1 commit intopython:mainfrom
AA-Turner:zstd-no-subclass
May 8, 2025
Merged

GH-132983: Remove subclassing support from zstd types#133694
AA-Turner merged 1 commit intopython:mainfrom
AA-Turner:zstd-no-subclass

Conversation

@AA-Turner
Copy link
Member

@AA-Turner AA-Turner commented May 8, 2025

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
Copy link
Contributor

@Rogdham Rogdham left a 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?

@AA-Turner
Copy link
Member Author

See #133674, which does the rename.

@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
42 checks passed
@AA-Turner AA-Turner added the needs backport to 3.14 bugs and security fixes label May 9, 2025
@miss-islington-app
Copy link

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 9, 2025
…-133694)

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

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
@bedevere-app
Copy link

bedevere-app bot commented May 9, 2025

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

@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
…) (#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 <9087854+AA-Turner@users.noreply.github.com>
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
…33694)

For consistency with ``bz2``, ``lzma``, and ``zlib``.
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
…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

2 participants

Comments