gh-132493: Remove __annotations__ usage in inspect._signature_is_functionlike (#133415)
This check is potentially problematic because it could force evaluation of annotations unnecessarily. This doesn't trigger for builtin objects (functions, classes, or modules) with annotations, but it could trigger for third-party objects. The check was not particularly useful anyway, because it succeeds if ``__annotations__`` is a dict or None, so the only thing this did was guard against objects that have an ``__annotations__`` attribute that is of some other type. That doesn't seem particularly useful, so I just removed the check.
J
Jelle Zijlstra committed
cb6596c6aa30c8c3213c8746d5590e6e2757a6c1
Parent: 1978904
Committed by GitHub <noreply@github.com>
on 5/10/2025, 1:42:53 AM