Skip to content

__self__ on built-in functions is not as documented #58211

Open

Description

@SpecLad
mannequin
BPO 14003
Nosy @terryjreedy, @ezio-melotti, @merwok, @bitdancer, @voidspace, @anacrolix, @SpecLad, @eryksun, @vaultah, @DimitrisJim

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 2012-02-13.19:05:34.037>
labels = ['type-bug', '3.8', '3.9', '3.10', 'docs']
title = '__self__ on built-in functions is not as documented'
updated_at = <Date 2020-11-07.19:53:05.266>
user = 'https://github.com/SpecLad'

bugs.python.org fields:

activity = <Date 2020-11-07.19:53:05.266>
actor = 'iritkatriel'
assignee = 'docs@python'
closed = False
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2012-02-13.19:05:34.037>
creator = 'SpecLad'
dependencies = []
files = []
hgrepos = []
issue_num = 14003
keywords = []
message_count = 6.0
messages = ['153287', '153288', '153298', '153610', '153620', '244963']
nosy_count = 12.0
nosy_names = ['terry.reedy', 'ezio.melotti', 'eric.araujo', 'Arfrever', 'r.david.murray', 'michael.foord', 'anacrolix', 'docs@python', 'SpecLad', 'eryksun', 'vaultah', 'Jim Fasarakis-Hilliard']
pr_nums = []
priority = 'normal'
resolution = None
stage = 'needs patch'
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue14003'
versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

Linked PRs

Activity

  1. added
    3.11
    3.12
    3.13
    and removed
    3.8 (EOL)
    on Nov 22, 2023
  2. added a commit that references this issue on Mar 16, 2025
  3. self-assigned this
    on Apr 10, 2025
  4. removed
    3.11
    3.12
    on Apr 10, 2025
  5. added 5 commits that reference this issue on Apr 10, 2025
  6. added a commit that references this issue on Apr 12, 2025
  7. added a commit that references this issue on Apr 12, 2025
  8. added a commit that references this issue on Apr 12, 2025
  9. removed
    3.13
    on Apr 12, 2025
  10. skirpichev commented on Apr 13, 2025

    @skirpichev
    Member

    @picnixz, sorry. I don't think this should be closed: there is at least an apparent documentation issue. Docs says "__self__ is set to None (but see the next item)." for builtins. See also #132299.

  11. picnixz commented on Apr 13, 2025

    @picnixz
    Member

    Oh my bad! I thought this was sufficient

  12. adorilson commented on Apr 13, 2025

    @adorilson
    Contributor

    @skirpichev @picnixz I intend to fix this on #113574 .

    What do you guys think about something like:

    __self__ é definido para None. (CPython implementation detail: Nowadays, it has a different behaviour from that desired. See GH-58211 for more information.) See also built-in methods.

    The last sentence is to replace the currently unclear parenthesis.

  13. skirpichev commented on Apr 14, 2025

    @skirpichev
    Member

    I intend to fix this on

    Ok.

    What do you guys think about something like

    I think we shouldn't mention GH requests/issues. Either lets properly document current behavior (see also closed issue #132299) or adjust it per docs.

  14. adorilson commented on Apr 14, 2025

    @adorilson
    Contributor

    I think we shouldn't mention GH requests/issues.

    OK.

    Either lets properly document current behavior (see also closed issue #132299) or adjust it per docs.

    The problem is that the current CPython behavior doesn't match the expected one. Notice that the added tests are only CPython. If this behaviour changes in the future, it will fail, so this change will not pass unnoticed as a side effect of other changes, as @serhiy-storchaka said here.

    What if we add an entry to the Test section of the changelog and mention it here?

    Of course, we may do nothing. The problem is that this issue will continue to be open, and new duplicate issues will probably be opened.

  15. skirpichev commented on Apr 15, 2025

    @skirpichev
    Member

    The problem is that the current CPython behavior doesn't match the expected one.

    In my experience, in such cases - implementation win, i.e. docs should be corrected.

  16. removed their assignment
    on Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

docstype-bug

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions