You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
__self__ on built-in functions is not as documented #58211
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=Noneclosed_at=Nonecreated_at=<Date2012-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=<Date2020-11-07.19:53:05.266>user='https://github.com/SpecLad'
@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.
__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.
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.
Activity
pythongh-58211: Add tests for __self__ attribute of builtins functions
pythongh-58211: Put full URL to GH issue
pythongh-58211: Put imports alphabetically sorted
pythongh-58211: Use more strict assertions
pythongh-58211: Add test to builtin constants bound method
pythongh-58211: Remove redundant tests
gh-58211: Add tests for the `__self__` attribute of builtins functions (
pythongh-58211: Add tests for the `__self__` attribute of builtins fu…
[3.13] gh-58211: Add tests for the `__self__` attribute of builtins f…
skirpichev commentedon Apr 13, 2025
@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.picnixz commentedon Apr 13, 2025
Oh my bad! I thought this was sufficient
adorilson commentedon Apr 13, 2025
@skirpichev @picnixz I intend to fix this on #113574 .
What do you guys think about something like:
__self__é definido paraNone. (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.
skirpichev commentedon Apr 14, 2025
Ok.
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.
adorilson commentedon Apr 14, 2025
OK.
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.
skirpichev commentedon Apr 15, 2025
In my experience, in such cases - implementation win, i.e. docs should be corrected.