This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Document specialness of __doc__, and possibly other "special" attributes
Type: Stage: resolved
Components: Documentation Versions: Python 3.4, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: cvrebert, djc, docs@python, eric.araujo, ethan.furman, ezio.melotti, flox, georg.brandl, python-dev, r.david.murray, ssteiner
Priority: normal Keywords: easy, patch

Created on 2009-10-22 19:47 by ssteiner, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue7186.stoneleaf.01.patch ethan.furman, 2014-10-17 22:22 review
Messages (7)
msg94369 - (view) Author: steve steiner (ssteiner) Date: 2009-10-22 19:47
Around the time of the 2.6.4 release, it was suggested that Python 2.6.3
changed the __doc__ attribute to read-only.  See:
http://bugs.python.org/issue7183

When asked whether this read-only behaviour was intentional, Guido
answered, simply "Yes" and also wrote:

On Oct 22, 2009, at 1:58 PM, Guido van Rossum wrote:

Well __doc__ isn't a normal attribute -- it doesn't follow inheritance
rules.

I suggested that it might be helpful to document this "special"
behaviour and also any other attributes that are "special" though which
ones they might be are unknown at this time.
msg112769 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2010-08-04 07:46
This is similar with #9438, about __debug__ being read-only.
msg121001 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-11-12 00:58
Is this obsoleted by #9451?
msg121229 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-11-15 14:23
No, because that patch doesn't document the special inheritance rules for __doc__ (which are uniquely special even among special methods).  Now, exactly where one would want to document those rules, I'm not sure.
msg229610 - (view) Author: Ethan Furman (ethan.furman) * (Python committer) Date: 2014-10-17 22:22
Patch attached for the __doc__ attribute.
msg229612 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-10-17 22:29
Looks fine to me.
msg229631 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-10-18 05:26
New changeset 7c183c782401 by Ethan Furman in branch '3.4':
Issue7186: document that __doc__ is not inherited by subclasses
https://hg.python.org/cpython/rev/7c183c782401

New changeset cb8606fc84df by Ethan Furman in branch 'default':
Issue7186: document that __doc__ is not inherited by subclasses
https://hg.python.org/cpython/rev/cb8606fc84df
History
Date User Action Args
2022-04-11 14:56:54adminsetgithub: 51435
2014-10-18 05:28:54ethan.furmansetversions: + Python 3.4, Python 3.5, - Python 3.1, Python 2.7, Python 3.2
2014-10-18 05:28:40ethan.furmansetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2014-10-18 05:26:13python-devsetnosy: + python-dev
messages: + msg229631
2014-10-17 22:29:36r.david.murraysetmessages: + msg229612
2014-10-17 22:22:27ethan.furmansetfiles: + issue7186.stoneleaf.01.patch

nosy: + ethan.furman
messages: + msg229610

keywords: + patch
stage: needs patch -> patch review
2012-08-27 09:03:20cvrebertsetnosy: + cvrebert
2010-11-15 14:53:17ezio.melottisetnosy: + ezio.melotti
2010-11-15 14:23:45r.david.murraysetnosy: + r.david.murray
messages: + msg121229
2010-11-12 00:58:49eric.araujosetnosy: + eric.araujo

messages: + msg121001
versions: - Python 2.6
2010-08-04 07:47:05floxsetkeywords: + easy
2010-08-04 07:46:33floxsetversions: + Python 2.6, Python 3.1, Python 2.7, Python 3.2
nosy: + flox

messages: + msg112769

stage: needs patch
2010-08-03 16:50:44BreamoreBoysetassignee: georg.brandl -> docs@python

nosy: + docs@python
2010-08-03 14:16:36djcsetnosy: + djc
2009-10-22 19:47:33ssteinercreate