dr-carlos · GitHub

Closed

Closed

Conversation

… implement in fwdref format
…ion(format=Format.STRING)`
… partials

Closed

dr-carlos

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):
…tate functions
…ions
…on function class' __call__ attribute
…ate function
…et don't raise an error when used as annotate functions

@dr-carlos dr-carlos changed the title gh-141388: Fully support callables as annotate functions gh-141388: Fully support non-function callables as annotate functions

Nov 14, 2025

@dr-carlos

@dr-carlos

…nctions
…ate function

JelleZijlstra

# 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

Read the original on github.com ↗