mirror of
https://github.com/python/cpython.git
synced 2025-12-09 18:48:05 +00:00
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:
parent
3e5b82ed7e
commit
2b8ad9e6c5
7 changed files with 22 additions and 22 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue