New submission from Serhiy Storchaka <storchaka+cpyt...@gmail.com>:

There are differences between typing.Union and types.Union:

* typing.Union is indexable, types.Union is not.
* types.Union is a class, typing.Union is not.

types.Union corresponds to typing._UnionGenericAlias, not typing.Union. It is 
confusing that typing.Union and types.Union have the same name. Note also that 
most classes in the types module have the "Type" suffix: FunctionType, 
MethodType, ModuleType, etc. I think that it would be better to rename 
types.Union to types.UnionType.

----------
components: Interpreter Core
messages: 398128
nosy: gvanrossum, kj, pablogsal, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Rename types.Union to types.UnionType
versions: Python 3.10, Python 3.11

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44732>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to