bpo-41341: Recursive evaluation of ForwardRef in get_type_hints#21553
bpo-41341: Recursive evaluation of ForwardRef in get_type_hints#21553gvanrossum merged 2 commits into
Conversation
The issue raised by recursive evaluation is infinite recursion with recursive types. In that case, only the first recursive ForwardRef is evaluated.
This comment has been minimized.
This comment has been minimized.
gvanrossum
left a comment
There was a problem hiding this comment.
@isidentical This might help moving https://bugs.python.org/issue38605 forward (make from __future__ import annotations the default).
@ambv Assuming we get this to work, what would you think of backporting it to 3.9, even though beta5 is already released? On the one hand it's awfully late for such a change (and experience with the bpo issue above suggests it's not painful). On the other hand getting the same behavior for forward refs in 3.9 with from __future__ import annotations as it will have in 3.10 (regardless of that import) seems useful.
Sorry, something went wrong.
I had my own implementations, but I think I am going to rebase because it was kind of a workaround. |
Sorry, something went wrong.
|
@gvanrossum: Please replace |
Sorry, something went wrong.
|
@ambv @pablogsal can I please have a decision on whether to backport this to 3.9? See my previous comment. |
Sorry, something went wrong.
I think it makes sense, but being this |
Sorry, something went wrong.
|
Thanks @wyfo for the PR, and @gvanrossum for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9. |
Sorry, something went wrong.
…onGH-21553) The issue raised by recursive evaluation is infinite recursion with recursive types. In that case, only the first recursive ForwardRef is evaluated. (cherry picked from commit 653f420) Co-authored-by: wyfo <joperez@hotmail.fr>
…on#21553) The issue raised by recursive evaluation is infinite recursion with recursive types. In that case, only the first recursive ForwardRef is evaluated.
…on#21553) The issue raised by recursive evaluation is infinite recursion with recursive types. In that case, only the first recursive ForwardRef is evaluated.
…f or str Related: python/cpython#21553 (comment) Signed-off-by: John Andersen <johnandersenpdx@gmail.com>
…f or str Related: python/cpython#21553 (comment) Signed-off-by: John Andersen <johnandersenpdx@gmail.com>
…f or str Related: python/cpython#21553 (comment) Signed-off-by: John Andersen <johnandersenpdx@gmail.com>
…f or str Related: python/cpython#21553 (comment) Signed-off-by: John Andersen <johnandersenpdx@gmail.com>
…f or str Related: python/cpython#21553 (comment) Signed-off-by: John Andersen <johnandersenpdx@gmail.com>
recursive_guard argument was added in python/cpython#21553
…f or str Related: python/cpython#21553 (comment) Signed-off-by: John Andersen <johnandersenpdx@gmail.com>
The issue raised by recursive evaluation is infinite recursion with
recursive types. In that case, only the first recursive ForwardRef is
evaluated.
https://bugs.python.org/issue41341