MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / __get__

Method __get__

tools/python-3.11.9-amd64/Lib/functools.py:393–410  ·  view source on GitHub ↗
(self, obj, cls=None)

Source from the content-addressed store, hash-verified

391 return _method
392
393 def __get__(self, obj, cls=None):
394 get = getattr(self.func, "__get__", None)
395 result = None
396 if get is not None:
397 new_func = get(obj, cls)
398 if new_func is not self.func:
399 # Assume __get__ returning something new indicates the
400 # creation of an appropriate callable
401 result = partial(new_func, *self.args, **self.keywords)
402 try:
403 result.__self__ = new_func.__self__
404 except AttributeError:
405 pass
406 if result is None:
407 # If the underlying descriptor didn't do anything, treat this
408 # like an instance method
409 result = self._make_unbound_method().__get__(obj, cls)
410 return result
411
412 @property
413 def __isabstractmethod__(self):

Callers 1

_methodMethod · 0.45

Calls 3

_make_unbound_methodMethod · 0.95
partialClass · 0.85
getFunction · 0.70

Tested by

no test coverage detected