Closed
Closed
Conversation
Closed
| if call_func := getattr(annotate.__call__, "__func__", None): | ||
| return getattr(call_func, attr, default) | ||
| elif isinstance(annotate, type): | ||
| return getattr(annotate.__init__, attr, default) |
|
|
||
| return default | ||
|
|
||
| def _direct_call_annotate(func, annotate, format): |
dr-carlos
changed the title
gh-141388: Fully support callables as annotate functions
gh-141388: Fully support non-function callables as annotate functions
| # Redirect method attribute access to the underlying function. The C code | ||
| # verifies that the __func__ attribute is some kind of callable, so we need | ||
| # to look for attributes recursively. | ||
| if isinstance(annotate, types.MethodType): |
Open