(obj, name, default)
| 470 | |
| 471 | |
| 472 | def _lookup_special(obj, name, default): |
| 473 | # Follow the standard lookup behaviour for special methods. |
| 474 | from inspect import getattr_static, _descriptor_get |
| 475 | cls = type(obj) |
| 476 | try: |
| 477 | descr = getattr_static(cls, name) |
| 478 | except AttributeError: |
| 479 | return default |
| 480 | return _descriptor_get(descr, obj) |
| 481 | |
| 482 | |
| 483 | _sentinel = ['SENTINEL'] |
no test coverage detected
searching dependent graphs…