Closed miohtama closed 7 years ago
The same goes for Union
: It now basically inherits from Generic
and has an __args__
attribute.
The whole function needs some rework for Python 3.6. Union is also no longer a class (see https://github.com/python/typing/issues/380). I've started creating unit test for the project on my fork. So that we can know what works and what not beyond trial and error.
I know all this, and I've fixed the same problem in my other project, typeguard. I am in the process of fixing the code, assisted by the test suite written by @wheerd. But it will take some time because I've been swamped with my commercial work for a while. I'm hoping things will calm down in the coming couple weeks.
Does anyone know if there are better reflection APIs coming to typing
in the future versions of Python? @jukkal?
@miohtama It seems likely that reflection is going to improve. For example, have a look at https://github.com/python/typing/pull/377.
Should be fixed by 712d432ecd74ec2fa15faa52f0b435ca8f8061db.
Python 3.6 TupleMeta no longer has
__tuple_args__
. Hitting a Tuple annotation when runningsphinx-build
causes exception.Instead one can extra arguments from Tuple like:
However, I did not yet figure out how to handle the ellipsis case, as internals of typing.py are pretty mindblowing.