Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-76007: Deprecate zlib.__version__ attribute#140130

Merged
vstinner merged 3 commits into
python:mainpython/cpython:mainfrom
StanFromIreland:zlib-versionStanFromIreland/cpython:zlib-versionCopy head branch name to clipboard
Oct 15, 2025
Merged

gh-76007: Deprecate zlib.__version__ attribute#140130
vstinner merged 3 commits into
python:mainpython/cpython:mainfrom
StanFromIreland:zlib-versionStanFromIreland/cpython:zlib-versionCopy head branch name to clipboard

Conversation

@StanFromIreland

@StanFromIreland StanFromIreland commented Oct 14, 2025

Copy link
Copy Markdown
Member

Comment thread Modules/zlibmodule.c Outdated
Comment thread Modules/zlibmodule.c Outdated
Comment thread Modules/zlibmodule.c Outdated

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Comment thread Modules/zlibmodule.c
ZLIB_CRC32_COMBINE_METHODDEF
ZLIB_DECOMPRESS_METHODDEF
ZLIB_DECOMPRESSOBJ_METHODDEF
{"__getattr__", zlib_getattr, METH_VARARGS, "Module __getattr__"},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I tried to convert the function to Argument Clinic, but it failed, oh!

Error in file 'Modules/zlibmodule.c' on line 2019:
'__getattr__' is a special method and cannot be converted to Argument Clinic!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I tried that too :-)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would this be a valid feature request for AC or it’s somehow impossible?

@StanFromIreland StanFromIreland Oct 19, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I tried, and it is relatively straightforward (I based my implementation on METHOD_INIT's), here is a patch. I do not know if there was a reason for this not being done before, other than there not being a need, as it is explicitly in the unsupported list, maybe Victor knows more?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have no idea why it's not supported currently.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

What do you think about the patch?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can propose it as a PR.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I opened #140376

@vstinner vstinner merged commit 46f11b3 into python:main Oct 15, 2025
49 checks passed
@vstinner

Copy link
Copy Markdown
Member

Merged, thanks. I also saw that version but forgot to deprecate it :-)

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.