Skip to content

gh-149609: Raise deprecation warnings for abc.{abstractclassmethod,abstractstaticmethod,abstractproperty}#149636

Open
sobolevn wants to merge 4 commits into
python:mainfrom
sobolevn:issue-149609
Open

gh-149609: Raise deprecation warnings for abc.{abstractclassmethod,abstractstaticmethod,abstractproperty}#149636
sobolevn wants to merge 4 commits into
python:mainfrom
sobolevn:issue-149609

Conversation

@sobolevn
Copy link
Copy Markdown
Member

@sobolevn sobolevn commented May 10, 2026

…thod,abstractstaticmethod,abstractproperty}`
@read-the-docs-community
Copy link
Copy Markdown

read-the-docs-community Bot commented May 10, 2026

@hugovk
Copy link
Copy Markdown
Member

hugovk commented May 10, 2026

Any reason to rush removal after the min two years instead of the recommended five?

@hugovk
Copy link
Copy Markdown
Member

hugovk commented May 10, 2026

Please also list in the relevant pending-removal-in-3.x.rst in https://github.com/python/cpython/tree/main/Doc/deprecations

@picnixz
Copy link
Copy Markdown
Member

picnixz commented May 10, 2026

Any reason to rush removal after the min two years instead of the recommended five?

I think it's because they've been deprecated since 3.3. But as I said, IDEs still pick them up in the suggestion list but they would show them as deprecated sometimes (it's more an IDE issue here).

I'm in favor of having a 5 years deprecation because those could be still used and I think we should let people know that they don't need this pattern anymore.

Comment thread Doc/whatsnew/3.16.rst
@sobolevn
Copy link
Copy Markdown
Member Author

sobolevn commented May 10, 2026

Any reason to rush removal after the min two years instead of the recommended five?

I think that this is not a rush :)
They were deprecated for a decade now, many tools already mark them this way. Inluding IDEs, type checkers and linters.
There are known bugs that we can help prevent by not using the deprecated version.
Plus, it is easy to switch to a pure stdlib alternative.

If others strongly believe that 5 years is a must, then I can make the change :(

@hugovk
Copy link
Copy Markdown
Member

hugovk commented May 11, 2026

Searching the top 15k PyPI projects (from February) found 632 matching lines in 150 projects for @(abc\.)?abstract(classmethod|staticmethod|property).

GitHub finds 26.9k files.

I also recommend opening issues for Ruff and pyupgrade to rewrite these deprecations (we should do this more often!).

@sobolevn
Copy link
Copy Markdown
Member Author

I opened a new issue for ruff: astral-sh/ruff#25105
And rescheduled the removal to 3.21: a lot of packages rely on it :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants