]> granicus.if.org Git - python/commitdiff
Issue #26750: use inspect.isdatadescriptor instead of our own
authorGregory P. Smith <greg@krypto.org>
Tue, 16 Aug 2016 06:56:32 +0000 (23:56 -0700)
committerGregory P. Smith <greg@krypto.org>
Tue, 16 Aug 2016 06:56:32 +0000 (23:56 -0700)
_is_data_descriptor().

1  2 
Lib/unittest/mock.py

index ed915d26bcceda3cca70039c655b4b0d779fd1b9,669890a4de2c3b4bc18a05bfd474397088de2e64..eaa9c3d5850e33a7043651f6831ca7a2976fa52e
@@@ -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