Skip to content

Schedule removal for deprecated abc decorators #149609

Closed

Description

@aiwonderland

Proposal:

Remove deprecated abc.abstractclassmethod, abc.abstractstaticmethod and abc.abstractproperty for 3.16.
or maybe and an warn:

import warnings
# codes ...
class abstractproperty(property):
    __isabstractmethod__ = True

    def __init__(self, fget=None, fset=None, fdel=None, doc=None):
        warnings.warn(
            "abc.abstractproperty is deprecated and will be removed in Python 3.16. "
            "Use @property with @abstractmethod instead.",
            FutureWarning,
            stacklevel=2
        )
        super().__init__(fget, fset, fdel, doc)

Linked PRs

Activity

  1. changed the title [-]Remove deprecated abc.abstractclassmethod, etc for 3.16[/-] [+]Remove deprecated `abc.abstractclassmethod`, etc for 3.16[/+] on May 9, 2026
  2. added
    stdlibStandard Library Python modules in the Lib/ directory
    on May 9, 2026
  3. picnixz commented on May 9, 2026

    @picnixz
  4. picnixz commented on May 9, 2026

    @picnixz
    Member

    Oh wait, there was no warning? so no we can't remove them sorry.

  5. picnixz commented on May 9, 2026

    @picnixz
    Member

    They've been deprecated since 3.3. If we plan to deprecate them (warning+removal) we need a 5y period first now.

  6. changed the title [-]Remove deprecated `abc.abstractclassmethod`, etc for 3.16[/-] [+]Schedule removal for deprecated `abc` decorators[/+] on May 9, 2026
  7. picnixz commented on May 9, 2026

    @picnixz
    Member
  8. aiwonderland commented on May 9, 2026

    @aiwonderland
    Author
  9. JelleZijlstra commented on May 10, 2026

    @JelleZijlstra
    Member

    I haven't worked on the abc module at all, but my general view is that removing things is always costly as it can break libraries and make it harder for people to upgrade. These functions are marked as @deprecated in typeshed, so IDEs should already avoid suggesting them.

  10. picnixz commented on May 10, 2026

    @picnixz
    Member

    Unfortunately, they are still allowed in the suggestion list, but I guess it's more a problem for the IDE to solve. Do we have a policy on adding runtime warnings for deprecated functions actually? because those functions were only deprecated in docs.

  11. hugovk commented on May 10, 2026

    @hugovk
    Member

    Yes, PEP 387.

    If we want to remove them, we need runtime warnings first. ("For changes that are unable to raise a deprecation warning, consult with the steering council.")

    Warnings should be raised for a minimum of two feature releases, but five years is preferred:

    1. Wait for the warning to appear in at least two minor Python versions of the same major version, or one minor version in an older major version (e.g., for a warning in Python 3.10.0, you either wait until at least Python 3.12 or Python 4.0 to make the change). It is preferred, though, to wait 5 years before removal (e.g., warn starting in Python 3.10, removal in 3.15; this happens to coincide with the current lifetime of a minor release of Python).

    https://peps.python.org/pep-0387/#making-incompatible-changes

  12. self-assigned this
    on May 10, 2026
  13. added a commit that references this issue on May 10, 2026
  14. added a commit that references this issue on May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions