bpo-44732: Rename types.Union to types.UnionType (#27342)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
Hasan 2021-07-26 20:00:21 +04:00 committed by GitHub
parent 3e5b82ed7e
commit 2b8ad9e6c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 22 additions and 22 deletions

View file

@ -1,4 +1,4 @@
// types.Union -- used to represent e.g. Union[int, str], int | str
// types.UnionType -- used to represent e.g. Union[int, str], int | str
#include "Python.h"
#include "pycore_object.h" // _PyObject_GC_TRACK/UNTRACK
#include "pycore_unionobject.h"
@ -414,7 +414,7 @@ union_parameters(PyObject *self, void *Py_UNUSED(unused))
}
static PyGetSetDef union_properties[] = {
{"__parameters__", union_parameters, (setter)NULL, "Type variables in the types.Union.", NULL},
{"__parameters__", union_parameters, (setter)NULL, "Type variables in the types.UnionType.", NULL},
{0}
};
@ -424,7 +424,7 @@ static PyNumberMethods union_as_number = {
PyTypeObject _PyUnion_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
.tp_name = "types.Union",
.tp_name = "types.UnionType",
.tp_doc = "Represent a PEP 604 union type\n"
"\n"
"E.g. for int | str",