GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||
GeezerVison is showing github.com — gh-156924: Try reifying lazy imports in `ForwarRef.evaluate()` by Viicos · Pull Request #156940 · python/cpython Conversation
|
|
This looks right to me, and it also now correctly resolves lazy imports that would succeed if the annotations would fail for a different reason (other than a missing name): from annotationlib import get_annotations, Format lazy from typing import Any class Example: a: object.fail b: Any annos = get_annotations(Example, format=Format.FORWARDREF) print(annos['b']) Before: <lazy_import 'typing.Any'> With this PR: typing.Any |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@Viicos could you add a unit test for the case @DavidCEllis brings up? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Bartosz Sławecki <[email protected]>
There was an error while loading. Please reload this page.
|
Thanks @Viicos for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-157224 is a backport of this pull request to the 3.15 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…GH-156940) (#157224) Co-authored-by: Victorien <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]> Co-authored-by: Petr Viktorin <[email protected]> Co-authored-by: Bartosz Sławecki <[email protected]>
* main: (158 commits) pythongh-156924: Try reifying lazy imports in `ForwarRef.evaluate()` (python#156940) pythongh-156233: Fix typos and code snippet errors in the docs (python#156475) pythongh-156837: Refer to yield expressions in generator function definitions (pythonGH-156863) pythongh-155292: Skip updating unicodedata with mismatched interpreter (pythonGH-157066) pythongh-157170: Document the scope of global curses settings (pythonGH-157207) pythongh-155966: Correct handling of `math.tanpi` poles (python#155980) pythongh-157170: Restore use_env() after test_use_prescr_screen in test_curses (pythonGH-157171) pythongh-156910: fix deadlock in type_set_abstractmethods under free-threading (python#156948) pythongh-155648: Write the empty and placeholder IDLE tests (python#156260) pythongh-153569: centralize formatted-string state and source spans (python#156484) pythongh-157137: Mark the PEP 820 soft deprecations as 3.15, not `next` (python#157138) pythongh-152433: Use regular LoadLibrary in UWP for Windows system libs (pythonGH-156972) pythongh-121617: Fix Py_CLEAR() memcpy in C++: replace NULL with _Py_NULL (python#157188) pythongh-157135: Fix documentation errors in the `math.atan{2}pi` functions (python#157136) pythongh-121617: Fix Py_CLEAR() in C++: replace NULL with _Py_NULL (python#157067) pythongh-156774: Speed up pdb startup with asyncio guard (python#156775) pythongh-156109: Allow static, non-framework iOS builds (python#156110) pythongh-156780: Emscripten: add missing EM_JS_DEPS (python#156798) pythongh-152936: Make privileged functions available on Android (python#152977) pythongh-123018: Keep the libedit history file header when truncating (pythonGH-157165) ...
…ython#156940) Co-authored-by: Jelle Zijlstra <[email protected]> Co-authored-by: Petr Viktorin <[email protected]> Co-authored-by: Bartosz Sławecki <[email protected]>
…ython#156940) Co-authored-by: Jelle Zijlstra <[email protected]> Co-authored-by: Petr Viktorin <[email protected]> Co-authored-by: Bartosz Sławecki <[email protected]>
…ate()` (pythonGH-156940) (python#157224) Co-authored-by: Victorien <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]> Co-authored-by: Petr Viktorin <[email protected]> Co-authored-by: Bartosz Sławecki <[email protected]> (cherry picked from commit 013c4ae)
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.