| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…s_functionlike 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.
There was a problem hiding this comment.
LGTM.
A nitpick about tests.
Sorry, something went wrong.
|
Thanks! I am planning to backport this since it's better to get the annotation changes all at once in 3.14, and removing unnecessary evaluation of annotations feels like a bugfix. |
Sorry, something went wrong.
|
Thanks @JelleZijlstra for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14. |
Sorry, something went wrong.
…s_functionlike (pythonGH-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. (cherry picked from commit cb6596c) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
GH-133796 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
…is_functionlike (GH-133415) (#133796) gh-132493: Remove __annotations__ usage in inspect._signature_is_functionlike (GH-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. (cherry picked from commit cb6596c) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
…s_functionlike (python#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.
…s_functionlike (python#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.
| Back | FazBrowse Home | New Git URL |
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.