-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inspect.ismethoddescriptor(): lack of __delete__() is not checked #120381
Labels
type-bug
An unexpected behavior, bug, or error
Comments
zuo
added a commit
to zuo/cpython
that referenced
this issue
Jun 12, 2024
The inspect.ismethoddescriptor() function did not check for the lack of __delete__() and, consequently, erroneously returned True when applied to *data* descriptors with __get__() and __delete__().
ncoghlan
added a commit
that referenced
this issue
Jun 18, 2024
The `inspect.ismethoddescriptor()` function did not check for the lack of `__delete__()` and, consequently, erroneously returned True when applied to *data* descriptors with only `__get__()` and `__delete__()` defined. Co-authored-by: Bénédikt Tran <[email protected]> Co-authored-by: Alyssa Coghlan <[email protected]>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Jun 18, 2024
The `inspect.ismethoddescriptor()` function did not check for the lack of `__delete__()` and, consequently, erroneously returned True when applied to *data* descriptors with only `__get__()` and `__delete__()` defined. (cherry picked from commit dacc5ac) Co-authored-by: Jan Kaliszewski <[email protected]> Co-authored-by: Bénédikt Tran <[email protected]> Co-authored-by: Alyssa Coghlan <[email protected]>
ncoghlan
added a commit
that referenced
this issue
Jun 19, 2024
The `inspect.ismethoddescriptor()` function did not check for the lack of `__delete__()` and, consequently, erroneously returned True when applied to *data* descriptors with only `__get__()` and `__delete__()` defined. (cherry picked from commit dacc5ac) Co-authored-by: Jan Kaliszewski <[email protected]> Co-authored-by: Bénédikt Tran <[email protected]> Co-authored-by: Alyssa Coghlan <[email protected]>
Merged and fixed for the next 3.13 beta. Thanks for the report and PR, @zuo! |
picnixz
added a commit
to picnixz/cpython
that referenced
this issue
Jun 19, 2024
The `inspect.ismethoddescriptor()` function did not check for the lack of `__delete__()` and, consequently, erroneously returned True when applied to *data* descriptors with only `__get__()` and `__delete__()` defined. Co-authored-by: Bénédikt Tran <[email protected]> Co-authored-by: Alyssa Coghlan <[email protected]>
Thank you too! :) |
mrahtz
pushed a commit
to mrahtz/cpython
that referenced
this issue
Jun 30, 2024
The `inspect.ismethoddescriptor()` function did not check for the lack of `__delete__()` and, consequently, erroneously returned True when applied to *data* descriptors with only `__get__()` and `__delete__()` defined. Co-authored-by: Bénédikt Tran <[email protected]> Co-authored-by: Alyssa Coghlan <[email protected]>
noahbkim
pushed a commit
to hudson-trading/cpython
that referenced
this issue
Jul 11, 2024
The `inspect.ismethoddescriptor()` function did not check for the lack of `__delete__()` and, consequently, erroneously returned True when applied to *data* descriptors with only `__get__()` and `__delete__()` defined. Co-authored-by: Bénédikt Tran <[email protected]> Co-authored-by: Alyssa Coghlan <[email protected]>
estyxx
pushed a commit
to estyxx/cpython
that referenced
this issue
Jul 17, 2024
The `inspect.ismethoddescriptor()` function did not check for the lack of `__delete__()` and, consequently, erroneously returned True when applied to *data* descriptors with only `__get__()` and `__delete__()` defined. Co-authored-by: Bénédikt Tran <[email protected]> Co-authored-by: Alyssa Coghlan <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug report
Bug description:
The
inspect.ismethoddescriptor()
function reports descriptor objects which implement__delete__()
but not__set__()
as method descriptors, even though they are, in fact, data descriptors:Actual behavior example:
Expected result:
See also: https://discuss.python.org/t/inspect-ismethoddescriptor-checks-for-the-lack-of-set-but-ignores-delete-should-it-be-fixed/55039
There is an additional question: to which Python versions should the fix be applied?
IMHO, the fix can be safely applied to the branches 3.14 (main) and 3.13 (still in the beta phase). Backporting it to the earlier versions might be considered too disruptive. Obviously, the decision will need to be made by a core developer, not me.
CPython versions tested on:
3.8, 3.9, 3.10, 3.11, 3.12, 3.13, CPython main branch
Linked PRs
The text was updated successfully, but these errors were encountered: