Skip to content

__base__ undocumented #66646

Closed
Closed

Description

@Arfrever
mannequin
BPO 22456
Nosy @gvanrossum, @rhettinger
Files
  • function-documentation.patch: Patch containing documentation of base
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2014-09-21.22:54:27.151>
    labels = ['easy', 'type-feature', 'docs']
    title = '__base__ undocumented'
    updated_at = <Date 2014-09-30.12:59:10.672>
    user = 'https://bugs.python.org/Arfrever'

    bugs.python.org fields:

    activity = <Date 2014-09-30.12:59:10.672>
    actor = 'anupama.srinivas.murthy'
    assignee = 'docs@python'
    closed = False
    closed_date = None
    closer = None
    components = ['Documentation']
    creation = <Date 2014-09-21.22:54:27.151>
    creator = 'Arfrever'
    dependencies = []
    files = ['36760']
    hgrepos = []
    issue_num = 22456
    keywords = ['patch', 'easy']
    message_count = 5.0
    messages = ['227241', '227242', '227243', '227245', '227903']
    nosy_count = 5.0
    nosy_names = ['gvanrossum', 'rhettinger', 'Arfrever', 'docs@python', 'anupama.srinivas.murthy']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = None
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue22456'
    versions = ['Python 2.7', 'Python 3.4', 'Python 3.5']

    Linked PRs

    Activity

    1. Arfrever commented on Sep 21, 2014

      Arfrevermannequin
      MannequinAuthor

      __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
    2. added
      docsDocumentation in the Doc dir
      type-featureA feature request or enhancement
      on Sep 21, 2014
    3. rhettinger commented on Sep 21, 2014

      @rhettinger
      Contributor

      I think that __base__ was intended to be a non-guaranteed implementation detail for new-style classes just like __dictoffset__ and __flags__ .

    4. gvanrossum commented on Sep 22, 2014

      @gvanrossum
      Member

      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.

    5. Arfrever commented on Sep 22, 2014

      Arfrevermannequin
      MannequinAuthor

      __base__ exists also in Jython and PyPy.

    6. anupamasrinivasmurthy commented on Sep 30, 2014

      anupamasrinivasmurthymannequin
      Mannequin

      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/

    7. transferred this issue fromon Apr 10, 2022
    8. furkanonder commented on Mar 9, 2023

      @furkanonder
      Contributor

      __bases__ is an undocumented feature. I believe it is worth mentioning in the object.rst , stdtypes.rst and datamodel.rst documents.

    9. merwok commented on Mar 9, 2023

      @merwok
      Member

      It’s an undocumented implementation detail, not a language feature.

    10. added
      pendingThe issue will be closed if no feedback is provided
      on Apr 1, 2023
    11. furkanonder commented on May 11, 2023

      @furkanonder
      Contributor

      @arhadthedev Why did you close the issue? PR was opened for this issue and it was being considered.

    12. 3 remaining items

    13. removed
      pendingThe issue will be closed if no feedback is provided
      on Dec 13, 2023
    14. added
      triagedThe issue has been accepted as valid by a triager.
      3.15bugs and security fixes
      on Aug 19, 2025
    15. merwok commented on Sep 18, 2025

      @merwok
    16. added a commit that references this issue on Oct 20, 2025
    17. added 2 commits that reference this issue on Oct 20, 2025
    18. added 2 commits that reference this issue on Oct 21, 2025
    19. moved this from Todo to Done in docs issueson Oct 22, 2025
    20. added a commit that references this issue on Dec 6, 2025
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.15bugs and security fixesdocsDocumentation in the Doc dirtriagedThe issue has been accepted as valid by a triager.type-featureA feature request or enhancement

      Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions