Issue 28886: Move deprecated abc module decorators to separate section in docs (original) (raw)

Issue28886

process

Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Darren.Dale, John Hagen, benjamin.peterson, daniel.urban, docs@python, dsdale24, eric.araujo, eric.snow, methane, ncoghlan, python-dev, stutzbach
Priority: normal Keywords: patch

Created on 2016-12-06 13:43 by John Hagen, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
bpo-28886_3.7.patch harshul1610,2017-02-19 15:07 review
Pull Requests
URL Status Linked Edit
PR 176 merged harshul1610,2017-02-19 15:04
PR 5787 merged miss-islington,2018-02-21 04:31
PR 5788 merged miss-islington,2018-02-21 04:32
Messages (6)
msg282548 - (view) Author: John Hagen (John Hagen) * Date: 2016-12-06 13:43
In the abc module (https://docs.python.org/3/library/abc.html) the following decorators have been deprecated since Python 3.3: - abstractclassmethod - abstractstaticmethod - abstractproperty But if you run the following example code using Python 3.5.2 with -Werror, no DeprecationWarnings are thrown. Throwing DeprecationWarnings will help make it more clear that these properties should not be used. PyCharm, for example, will strikethrough the usage of methods that throw DeprecationWarning so that even new users will be notified quickly even if they don't run with -Werror. import abc class Base(abc.ABC): @abc.abstractclassmethod def abstract_class(cls): pass @abc.abstractstaticmethod def abstract_static(): pass @abc.abstractproperty def abstract_property(self): pass class Child(Base): @classmethod def abstract_class(cls): print('Abstract class method') @staticmethod def abstract_static(): print('Abstract static method') @property def abstract_property(self): return 'Abstract property' child = Child() child.abstract_class() child.abstract_static() print(child.abstract_property)
msg282569 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-12-06 20:00
Not all features deprecated in the source should be deprecated in the code. May be reasons for not doing this in the code. Adding the deprecation in maintained releases can introduce a regression. It seems to me that these decorators are not broken. They is just other, more preferable way to write the same, with the combination of other decorators.
msg282582 - (view) Author: Alyssa Coghlan (ncoghlan) * (Python committer) Date: 2016-12-07 00:52
Right, these are in the "Don't use them in new code, but we have absolutely no plans to actually remove them" documentation-only category of deprecation warning. However, I'm converting this to a documentation enhancement request, as the documentation could make that status clearer by moving them to a separate "Legacy builtin decorator subclasses" section at the end of https://docs.python.org/3/library/abc.html Then that section can *start* with the information on simply applying the builtin decorators on top of the abc.abstractproperty() decorator, before moving on to document the available subclasses.
msg312459 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2018-02-21 04:30
New changeset 52c6b89796a7ec391db20281e05b256f57e97b35 by INADA Naoki (Harshul jain) in branch 'master': bpo-28886: doc: Move deprecated abc decorators to separate section (GH-176) https://github.com/python/cpython/commit/52c6b89796a7ec391db20281e05b256f57e97b35
msg312461 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2018-02-21 05:24
New changeset 7452f6d8fa3ffe5dab20f7e4244851a6eca397be by INADA Naoki (Miss Islington (bot)) in branch '3.7': bpo-28886: doc: Move deprecated abc decorators to separate section (GH-176) https://github.com/python/cpython/commit/7452f6d8fa3ffe5dab20f7e4244851a6eca397be
msg312462 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2018-02-21 05:24
New changeset 0150dc589439a9a78c80c2aa8d7d6c5d3bba1d6d by INADA Naoki (Miss Islington (bot)) in branch '3.6': bpo-28886: doc: Move deprecated abc decorators to separate section (GH-176) https://github.com/python/cpython/commit/0150dc589439a9a78c80c2aa8d7d6c5d3bba1d6d
History
Date User Action Args
2022-04-11 14:58:40 admin set github: 73072
2018-02-21 14:05:22 methane set status: open -> closedresolution: fixedstage: patch review -> resolved
2018-02-21 05:24:39 methane set messages: +
2018-02-21 05:24:24 methane set messages: +
2018-02-21 04:32:09 miss-islington set pull_requests: + <pull%5Frequest5569>
2018-02-21 04:31:10 miss-islington set stage: needs patch -> patch reviewpull_requests: + <pull%5Frequest5568>
2018-02-21 04:30:04 methane set nosy: + methanemessages: +
2017-02-19 15:07:10 harshul1610 set files: + bpo-28886_3.7.patchkeywords: + patch
2017-02-19 15:04:06 harshul1610 set pull_requests: + <pull%5Frequest141>
2016-12-07 05:36:04 serhiy.storchaka set nosy: - serhiy.storchaka
2016-12-07 00:52:50 ncoghlan set assignee: docs@pythontype: behavior -> enhancementcomponents: + Documentation, - Library (Lib)title: Deprecated abstract base class (abc) decorators do not raise DeprecationWarning -> Move deprecated abc module decorators to separate section in docsnosy: + docs@pythonmessages: + stage: needs patch
2016-12-06 20:00:38 serhiy.storchaka set nosy: + stutzbach, dsdale24, python-dev, eric.snow, serhiy.storchaka, ncoghlan, daniel.urban, eric.araujo, Darren.Dale, benjamin.petersonmessages: +
2016-12-06 13:43:37 John Hagen create