Message396346
I agree that this is a bug. `types.Union` is also missing a __getitem__ implementation.
And `typing.Union` supports pickling while `types.Union` doesn't:
>>> pickle.loads(pickle.dumps(int | str))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: cannot pickle 'types.Union' object
>>> pickle.loads(pickle.dumps(Union[int, str]))
typing.Union[int, str]
I don't have a use case for pickling types but someone might. |
|
| Date |
User |
Action |
Args |
| 2021-06-22 15:00:20 | JelleZijlstra | set | recipients:
+ JelleZijlstra, gvanrossum, levkivskyi, kj |
| 2021-06-22 15:00:20 | JelleZijlstra | set | messageid: <[email protected]> |
| 2021-06-22 15:00:20 | JelleZijlstra | link | issue44490 messages |
| 2021-06-22 15:00:20 | JelleZijlstra | create | |
|