From: Gregory P. Smith Date: Tue, 16 Aug 2016 06:56:32 +0000 (-0700) Subject: Issue #26750: use inspect.isdatadescriptor instead of our own X-Git-Tag: v3.6.0b1~708 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c35a32fe850c3fc1edf32569b7aee8468209a23f;p=python Issue #26750: use inspect.isdatadescriptor instead of our own _is_data_descriptor(). --- c35a32fe850c3fc1edf32569b7aee8468209a23f diff --cc Lib/unittest/mock.py index ed915d26bc,669890a4de..eaa9c3d585 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@@ -60,12 -60,18 +60,6 @@@ def _is_exception(obj) ) - def _is_data_descriptor(obj): - # Data descriptors are Properties, slots, getsets and C data members. - return ((hasattr(obj, '__set__') or hasattr(obj, '__del__')) and - hasattr(obj, '__get__')) -class _slotted(object): - __slots__ = ['a'] - - -# Do not use this tuple. It was never documented as a public API. -# It will be removed. It has no obvious signs of users on github. -DescriptorTypes = ( - type(_slotted.a), - property, -) -- -- def _get_signature_object(func, as_instance, eat_self): """ Given an arbitrary, possibly callable object, try to create a suitable