)
- 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