Skip to content

Conversation

@miss-islington
Copy link
Contributor

@miss-islingtonmiss-islington commented May 10, 2025

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 [email protected]

…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 <[email protected]>
@JelleZijlstraJelleZijlstra enabled auto-merge (squash) May 10, 2025 01:43
@JelleZijlstraJelleZijlstra merged commit dc441ef into python:3.14May 26, 2025
47 checks passed
@miss-islingtonmiss-islington deleted the backport-cb6596c-3.14 branch January 2, 2026 18:44
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@miss-islington@JelleZijlstra