Open smarie opened 6 years ago
I like the is_forward_ref
. But for eval_forward_ref
I think we should use more of typing logic used in get_type_hints
, i.e. support custom locals
and globals
.
@ilevkivskyi @smarie is there any news on this? I'll be hardcoding is_forward_ref
function to my lib to work with this but it would be great to have them at typing_inspect
:)
@allrod5
I think adding is_forward_ref()
totally makes sense (it needs to also account the renaming of _ForwardRef
to ForwardRef
in newer Python versions). I recently needed it myself actually. Would you like to make a PR?
I surely can, will do it soon :)
@ilevkivskyi submitted: https://github.com/ilevkivskyi/typing_inspect/pull/57
Could you release the latest version of the library with forward_ref support?
OK, I will make a release soon.
I just uploaded new version to PyPI: https://pypi.org/project/typing-inspect/0.6.0/
Thanks!
Not sure these need to be in typing_inspect, but for I am currently relying on the private names so I guess there is maybe something to do in the api here?
As always if this is too high-level / specific, feel, free to suggest to move it to pytypes or equivalent libs. For example the
eval_forward_ref
above could be replaced with the low-level