MCPcopy Index your code
hub / github.com/python/cpython / Descriptor

Class Descriptor

Lib/test/test_abc.py:231–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229
230 def test_customdescriptors_with_abstractmethod(self):
231 class Descriptor:
232 def __init__(self, fget, fset=None):
233 self._fget = fget
234 self._fset = fset
235 def getter(self, callable):
236 return Descriptor(callable, self._fget)
237 def setter(self, callable):
238 return Descriptor(self._fget, callable)
239 @property
240 def __isabstractmethod__(self):
241 return (getattr(self._fget, '__isabstractmethod__', False)
242 or getattr(self._fset, '__isabstractmethod__', False))
243 class C(metaclass=abc_ABCMeta):
244 @Descriptor
245 @abc.abstractmethod

Callers 2

getterMethod · 0.70
setterMethod · 0.70

Calls

no outgoing calls

Tested by 2

getterMethod · 0.56
setterMethod · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…