gh-138425: Correctly partially evaluate global generics with undefined params in ref.evaluate(format=Format.FORWARDREF)#138430
Conversation
Co-authored-by: sobolevn <[email protected]>
…fined generic tests Removed global overriding builtin test as it seemingly wasn't compatible with `get_annotations()`.
|
Note that this PR also inherently fixes builtins overriding globals in this particular code path. I was previously unable to come up with a test for this without using the undocumented It feels very unlikely this would happen in real code, and I'm not sure if it's a good idea to test given that "Since this is an implementation detail, it may not be used by alternate implementations of Python." (https://docs.python.org/3/library/builtins.html), and given that |
|
Good point, I think it's fine to skip the test in that case. Technical issue: your two PRs #138430 and #138075 will conflict with each other, and I won't be able to backport them to 3.14 until after 3.14.0 final comes out. So I'm planning to leave them open for now and land them once 3.14.0 final is out so I can sort out the merge conflicts and merge the backports without having to disrupt the RC process. |
@JelleZijlstra Just a quick reminder of these PRs - any updates now that 3.14.0 final is out? |
|
Thanks @dr-carlos for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
…defined params in `ref.evaluate(format=Format.FORWARDREF)` (pythonGH-138430) (cherry picked from commit e66f87c) Co-authored-by: dr-carlos <[email protected]> Co-authored-by: sobolevn <[email protected]>
|
GH-140927 is a backport of this pull request to the 3.14 branch. |
…ndefined params in `ref.evaluate(format=Format.FORWARDREF)` (GH-138430) (#140927) gh-138425: Correctly partially evaluate global generics with undefined params in `ref.evaluate(format=Format.FORWARDREF)` (GH-138430) (cherry picked from commit e66f87c) Co-authored-by: dr-carlos <[email protected]> Co-authored-by: sobolevn <[email protected]>
|
Thanks for the merges @JelleZijlstra! |
…defined params in `ref.evaluate(format=Format.FORWARDREF)` (python#138430) Co-authored-by: sobolevn <[email protected]>
ref.evaluate(format=Format.FORWARDREF)not evaluating global generics with undefined params #138425