You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's an interesting interaction, with Python 3.6 the union type hint is no longer a class (while tuple still is),, as opposed to 3.5 where both are. Is this a bug, or a valid change? And if valid what's the reason for the inconsistency?
This is intentional. Union has no way to be a valid runtime class (one can neither inherit it, nor instantiate). At the same time Tuple has a runtime counterpart tuple equivalent to Tuple[Any, ...].
By subclassing Tuple one can indicate that a certain class supports "tuple protocol" and there is no way to annotate __getitem__ as expressive as inheriting from Tuple[str, int].
Here's an interesting interaction, with Python 3.6 the union type hint is no longer a class (while tuple still is),, as opposed to 3.5 where both are. Is this a bug, or a valid change? And if valid what's the reason for the inconsistency?
Produces the following output:
The text was updated successfully, but these errors were encountered: