[issue43355] __future__.annotations breaks inspect.signature()

2021-03-03 Thread Eric Engestrom
Eric Engestrom added the comment: (... and I had the window open for too long and didn't notice Ken's reply before mine ^^') @kj: thanks for the workaround! it's good to be able to change our code and not have to depend on a yet-to-be-released patch on each python v

[issue43355] __future__.annotations breaks inspect.signature()

2021-03-03 Thread Eric Engestrom
Eric Engestrom added the comment: Sorry, I just realized you asked for the "success" value as well. For python 3.7-3.9 without the `import annotations`, and for python 3.10, the type annotation is a class, ie. ``. -- ___ Python track

[issue43355] __future__.annotations breaks inspect.signature()

2021-03-03 Thread Eric Engestrom
Eric Engestrom added the comment: Sure thing. Putting the reproducing code in `test_foo.py` and running `docker run --rm -it -v $PWD:/code python sh -c 'pip install pytest && pytest -vvv /code/test_foo.py'` yields: ``` Collecting pytest Downloading pytest-6.2.2-py3-no

[issue43355] __future__.annotations breaks inspect.signature()

2021-03-01 Thread Eric Engestrom
New submission from Eric Engestrom : We have a pytest that boils down to the following: ``` #from __future__ import annotations from inspect import Parameter, signature def foo(x: str) -> str: return x + x def test_foo(): expected = ( Parameter