mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
[3.13] gh-122087: Restore ismethoddescriptor() and isroutine() for partial objects (GH-122218)
Now they return False again.
This commit is contained in:
parent
716c6771fc
commit
4e7716554b
3 changed files with 10 additions and 0 deletions
|
@ -325,6 +325,11 @@ def ismethoddescriptor(object):
|
|||
if isclass(object) or ismethod(object) or isfunction(object):
|
||||
# mutual exclusion
|
||||
return False
|
||||
if isinstance(object, functools.partial):
|
||||
# Lie for children. The addition of partial.__get__
|
||||
# doesn't currently change the partial objects behaviour,
|
||||
# not counting a warning about future changes.
|
||||
return False
|
||||
tp = type(object)
|
||||
return (hasattr(tp, "__get__")
|
||||
and not hasattr(tp, "__set__")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue