Issue 22456: base undocumented - Python tracker (original) (raw)

Created on 2014-09-21 22:54 by Arfrever, last changed 2022-04-11 14:58 by admin.

Files
File name Uploaded Description Edit
function-documentation.patch anupama.srinivas.murthy,2014-09-30 12:59 Patch containing documentation of __base__ review
Messages (5)
msg227241 - (view) Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * (Python triager) Date: 2014-09-21 22:54
__bases__ is documented, but __base__ is not. $ grep -r __base__ Doc $ grep -r __bases__ Doc Doc/c-api/object.rst:are different objects, *B*'s :attr:`~class.__bases__` attribute is searched in Doc/c-api/object.rst:a depth-first fashion for *A* --- the presence of the :attr:`~class.__bases__` Doc/extending/newtypes.rst: in its :attr:`~class.__bases__`, or else it will not be able to call your type's Doc/library/email.headerregistry.rst: class's ``__bases__`` list. Doc/library/functions.rst: tuple itemizes the base classes and becomes the :attr:`~class.__bases__` Doc/library/stdtypes.rst:.. attribute:: class.__bases__ Doc/reference/datamodel.rst: single: __bases__ (class attribute) Doc/reference/datamodel.rst: dictionary containing the class's namespace; :attr:`~class.__bases__` is a Doc/whatsnew/2.3.rst: removed: you can now assign to the :attr:`__name__` and :attr:`__bases__` Doc/whatsnew/2.3.rst: assigned to :attr:`__bases__` along the lines of those relating to assigning to
msg227242 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2014-09-21 23:46
I think that __base__ was intended to be a non-guaranteed implementation detail for new-style classes just like __dictoffset__ and __flags__ .
msg227243 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2014-09-22 00:07
Raymond is correct. __base__ is closely tied to the C implementation. I think it might be worth a mention, but with an explicit note that it is CPython-specific. It is sometimes useful, e.g. when wondering why a certain case of multiple inheritance is rejected.
msg227245 - (view) Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * (Python triager) Date: 2014-09-22 00:13
__base__ exists also in Jython and PyPy.
msg227903 - (view) Author: anupama srinivas murthy (anupama.srinivas.murthy) * Date: 2014-09-30 12:59
I have documented the function in object.rst file. I do not know the use of the function and have not mentioned that. My documentation is based on what I understood from the comments below and the explanation here: http://code.activestate.com/lists/python-list/334282/
History
Date User Action Args
2022-04-11 14:58:08 admin set github: 66646
2015-08-31 04:54:43 martin.panter link issue23639 dependencies
2014-09-30 12:59:10 anupama.srinivas.murthy set files: + function-documentation.patchnosy: + anupama.srinivas.murthymessages: + keywords: + patch
2014-09-22 00:13:38 Arfrever set messages: +
2014-09-22 00:07:09 gvanrossum set messages: +
2014-09-21 23:46:13 rhettinger set nosy: + gvanrossum, rhettingermessages: +
2014-09-21 22:54:27 Arfrever create