| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  | /*[clinic input]
 | 
					
						
							|  |  |  | preserve | 
					
						
							|  |  |  | [clinic start generated code]*/ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
 | 
					
						
							| 
									
										
										
										
											2023-08-31 23:42:34 +02:00
										 |  |  | #  include "pycore_gc.h"          // PyGC_Head
 | 
					
						
							|  |  |  | #  include "pycore_runtime.h"     // _Py_ID()
 | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2023-10-17 14:30:31 +02:00
										 |  |  | #include "pycore_modsupport.h"    // _PyArg_UnpackKeywordsWithVararg()
 | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | PyDoc_STRVAR(typevar_new__doc__, | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  | "typevar(name, *constraints, bound=None, default=typing.NoDefault,\n" | 
					
						
							|  |  |  | "        covariant=False, contravariant=False, infer_variance=False)\n" | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  | "--\n" | 
					
						
							|  |  |  | "\n" | 
					
						
							|  |  |  | "Create a TypeVar."); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | typevar_new_impl(PyTypeObject *type, PyObject *name, PyObject *constraints, | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  |                  PyObject *bound, PyObject *default_value, int covariant, | 
					
						
							|  |  |  |                  int contravariant, int infer_variance); | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | typevar_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     PyObject *return_value = NULL; | 
					
						
							|  |  |  |     #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  |     #define NUM_KEYWORDS 6
 | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  |     static struct { | 
					
						
							|  |  |  |         PyGC_Head _this_is_not_used; | 
					
						
							|  |  |  |         PyObject_VAR_HEAD | 
					
						
							|  |  |  |         PyObject *ob_item[NUM_KEYWORDS]; | 
					
						
							|  |  |  |     } _kwtuple = { | 
					
						
							|  |  |  |         .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  |         .ob_item = { &_Py_ID(name), &_Py_ID(bound), &_Py_ID(default), &_Py_ID(covariant), &_Py_ID(contravariant), &_Py_ID(infer_variance), }, | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  |     }; | 
					
						
							|  |  |  |     #undef NUM_KEYWORDS
 | 
					
						
							|  |  |  |     #define KWTUPLE (&_kwtuple.ob_base.ob_base)
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     #else  // !Py_BUILD_CORE
 | 
					
						
							|  |  |  |     #  define KWTUPLE NULL
 | 
					
						
							|  |  |  |     #endif  // !Py_BUILD_CORE
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  |     static const char * const _keywords[] = {"name", "bound", "default", "covariant", "contravariant", "infer_variance", NULL}; | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  |     static _PyArg_Parser _parser = { | 
					
						
							|  |  |  |         .keywords = _keywords, | 
					
						
							|  |  |  |         .fname = "typevar", | 
					
						
							|  |  |  |         .kwtuple = KWTUPLE, | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     #undef KWTUPLE
 | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  |     PyObject *argsbuf[7]; | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  |     PyObject * const *fastargs; | 
					
						
							|  |  |  |     Py_ssize_t nargs = PyTuple_GET_SIZE(args); | 
					
						
							|  |  |  |     Py_ssize_t noptargs = Py_MIN(nargs, 1) + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 1; | 
					
						
							|  |  |  |     PyObject *name; | 
					
						
							|  |  |  |     PyObject *constraints = NULL; | 
					
						
							|  |  |  |     PyObject *bound = Py_None; | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  |     PyObject *default_value = &_Py_NoDefaultStruct; | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  |     int covariant = 0; | 
					
						
							|  |  |  |     int contravariant = 0; | 
					
						
							|  |  |  |     int infer_variance = 0; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     fastargs = _PyArg_UnpackKeywordsWithVararg(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 1, 1, 0, 1, argsbuf); | 
					
						
							|  |  |  |     if (!fastargs) { | 
					
						
							|  |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     if (!PyUnicode_Check(fastargs[0])) { | 
					
						
							|  |  |  |         _PyArg_BadArgument("typevar", "argument 'name'", "str", fastargs[0]); | 
					
						
							|  |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     name = fastargs[0]; | 
					
						
							|  |  |  |     constraints = fastargs[1]; | 
					
						
							|  |  |  |     if (!noptargs) { | 
					
						
							|  |  |  |         goto skip_optional_kwonly; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     if (fastargs[2]) { | 
					
						
							|  |  |  |         bound = fastargs[2]; | 
					
						
							|  |  |  |         if (!--noptargs) { | 
					
						
							|  |  |  |             goto skip_optional_kwonly; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     if (fastargs[3]) { | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  |         default_value = fastargs[3]; | 
					
						
							|  |  |  |         if (!--noptargs) { | 
					
						
							|  |  |  |             goto skip_optional_kwonly; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     if (fastargs[4]) { | 
					
						
							|  |  |  |         covariant = PyObject_IsTrue(fastargs[4]); | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  |         if (covariant < 0) { | 
					
						
							|  |  |  |             goto exit; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         if (!--noptargs) { | 
					
						
							|  |  |  |             goto skip_optional_kwonly; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  |     if (fastargs[5]) { | 
					
						
							|  |  |  |         contravariant = PyObject_IsTrue(fastargs[5]); | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  |         if (contravariant < 0) { | 
					
						
							|  |  |  |             goto exit; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         if (!--noptargs) { | 
					
						
							|  |  |  |             goto skip_optional_kwonly; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  |     infer_variance = PyObject_IsTrue(fastargs[6]); | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  |     if (infer_variance < 0) { | 
					
						
							|  |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | skip_optional_kwonly: | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  |     return_value = typevar_new_impl(type, name, constraints, bound, default_value, covariant, contravariant, infer_variance); | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | exit: | 
					
						
							|  |  |  |     Py_XDECREF(constraints); | 
					
						
							|  |  |  |     return return_value; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | PyDoc_STRVAR(typevar_typing_subst__doc__, | 
					
						
							| 
									
										
										
										
											2023-08-29 17:55:56 +03:00
										 |  |  | "__typing_subst__($self, arg, /)\n" | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  | "--\n" | 
					
						
							|  |  |  | "\n"); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define TYPEVAR_TYPING_SUBST_METHODDEF    \
 | 
					
						
							| 
									
										
										
										
											2023-08-29 17:55:56 +03:00
										 |  |  |     {"__typing_subst__", (PyCFunction)typevar_typing_subst, METH_O, typevar_typing_subst__doc__}, | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  | PyDoc_STRVAR(typevar_typing_prepare_subst__doc__, | 
					
						
							|  |  |  | "__typing_prepare_subst__($self, alias, args, /)\n" | 
					
						
							|  |  |  | "--\n" | 
					
						
							|  |  |  | "\n"); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define TYPEVAR_TYPING_PREPARE_SUBST_METHODDEF    \
 | 
					
						
							|  |  |  |     {"__typing_prepare_subst__", _PyCFunction_CAST(typevar_typing_prepare_subst), METH_FASTCALL, typevar_typing_prepare_subst__doc__}, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | typevar_typing_prepare_subst_impl(typevarobject *self, PyObject *alias, | 
					
						
							|  |  |  |                                   PyObject *args); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | typevar_typing_prepare_subst(typevarobject *self, PyObject *const *args, Py_ssize_t nargs) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     PyObject *return_value = NULL; | 
					
						
							|  |  |  |     PyObject *alias; | 
					
						
							|  |  |  |     PyObject *__clinic_args; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if (!_PyArg_CheckPositional("__typing_prepare_subst__", nargs, 2, 2)) { | 
					
						
							|  |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     alias = args[0]; | 
					
						
							|  |  |  |     __clinic_args = args[1]; | 
					
						
							|  |  |  |     return_value = typevar_typing_prepare_subst_impl(self, alias, __clinic_args); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | exit: | 
					
						
							|  |  |  |     return return_value; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  | PyDoc_STRVAR(typevar_reduce__doc__, | 
					
						
							|  |  |  | "__reduce__($self, /)\n" | 
					
						
							|  |  |  | "--\n" | 
					
						
							|  |  |  | "\n"); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define TYPEVAR_REDUCE_METHODDEF    \
 | 
					
						
							|  |  |  |     {"__reduce__", (PyCFunction)typevar_reduce, METH_NOARGS, typevar_reduce__doc__}, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | typevar_reduce_impl(typevarobject *self); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | typevar_reduce(typevarobject *self, PyObject *Py_UNUSED(ignored)) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return typevar_reduce_impl(self); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  | PyDoc_STRVAR(typevar_has_default__doc__, | 
					
						
							|  |  |  | "has_default($self, /)\n" | 
					
						
							|  |  |  | "--\n" | 
					
						
							|  |  |  | "\n"); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define TYPEVAR_HAS_DEFAULT_METHODDEF    \
 | 
					
						
							|  |  |  |     {"has_default", (PyCFunction)typevar_has_default, METH_NOARGS, typevar_has_default__doc__}, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | typevar_has_default_impl(typevarobject *self); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | typevar_has_default(typevarobject *self, PyObject *Py_UNUSED(ignored)) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return typevar_has_default_impl(self); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  | PyDoc_STRVAR(paramspecargs_new__doc__, | 
					
						
							|  |  |  | "paramspecargs(origin)\n" | 
					
						
							|  |  |  | "--\n" | 
					
						
							|  |  |  | "\n" | 
					
						
							|  |  |  | "Create a ParamSpecArgs object."); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | paramspecargs_new_impl(PyTypeObject *type, PyObject *origin); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | paramspecargs_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     PyObject *return_value = NULL; | 
					
						
							|  |  |  |     #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     #define NUM_KEYWORDS 1
 | 
					
						
							|  |  |  |     static struct { | 
					
						
							|  |  |  |         PyGC_Head _this_is_not_used; | 
					
						
							|  |  |  |         PyObject_VAR_HEAD | 
					
						
							|  |  |  |         PyObject *ob_item[NUM_KEYWORDS]; | 
					
						
							|  |  |  |     } _kwtuple = { | 
					
						
							|  |  |  |         .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) | 
					
						
							|  |  |  |         .ob_item = { &_Py_ID(origin), }, | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     #undef NUM_KEYWORDS
 | 
					
						
							|  |  |  |     #define KWTUPLE (&_kwtuple.ob_base.ob_base)
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     #else  // !Py_BUILD_CORE
 | 
					
						
							|  |  |  |     #  define KWTUPLE NULL
 | 
					
						
							|  |  |  |     #endif  // !Py_BUILD_CORE
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     static const char * const _keywords[] = {"origin", NULL}; | 
					
						
							|  |  |  |     static _PyArg_Parser _parser = { | 
					
						
							|  |  |  |         .keywords = _keywords, | 
					
						
							|  |  |  |         .fname = "paramspecargs", | 
					
						
							|  |  |  |         .kwtuple = KWTUPLE, | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     #undef KWTUPLE
 | 
					
						
							|  |  |  |     PyObject *argsbuf[1]; | 
					
						
							|  |  |  |     PyObject * const *fastargs; | 
					
						
							|  |  |  |     Py_ssize_t nargs = PyTuple_GET_SIZE(args); | 
					
						
							|  |  |  |     PyObject *origin; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 1, 1, 0, argsbuf); | 
					
						
							|  |  |  |     if (!fastargs) { | 
					
						
							|  |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     origin = fastargs[0]; | 
					
						
							|  |  |  |     return_value = paramspecargs_new_impl(type, origin); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | exit: | 
					
						
							|  |  |  |     return return_value; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | PyDoc_STRVAR(paramspeckwargs_new__doc__, | 
					
						
							|  |  |  | "paramspeckwargs(origin)\n" | 
					
						
							|  |  |  | "--\n" | 
					
						
							|  |  |  | "\n" | 
					
						
							|  |  |  | "Create a ParamSpecKwargs object."); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | paramspeckwargs_new_impl(PyTypeObject *type, PyObject *origin); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | paramspeckwargs_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     PyObject *return_value = NULL; | 
					
						
							|  |  |  |     #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     #define NUM_KEYWORDS 1
 | 
					
						
							|  |  |  |     static struct { | 
					
						
							|  |  |  |         PyGC_Head _this_is_not_used; | 
					
						
							|  |  |  |         PyObject_VAR_HEAD | 
					
						
							|  |  |  |         PyObject *ob_item[NUM_KEYWORDS]; | 
					
						
							|  |  |  |     } _kwtuple = { | 
					
						
							|  |  |  |         .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) | 
					
						
							|  |  |  |         .ob_item = { &_Py_ID(origin), }, | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     #undef NUM_KEYWORDS
 | 
					
						
							|  |  |  |     #define KWTUPLE (&_kwtuple.ob_base.ob_base)
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     #else  // !Py_BUILD_CORE
 | 
					
						
							|  |  |  |     #  define KWTUPLE NULL
 | 
					
						
							|  |  |  |     #endif  // !Py_BUILD_CORE
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     static const char * const _keywords[] = {"origin", NULL}; | 
					
						
							|  |  |  |     static _PyArg_Parser _parser = { | 
					
						
							|  |  |  |         .keywords = _keywords, | 
					
						
							|  |  |  |         .fname = "paramspeckwargs", | 
					
						
							|  |  |  |         .kwtuple = KWTUPLE, | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     #undef KWTUPLE
 | 
					
						
							|  |  |  |     PyObject *argsbuf[1]; | 
					
						
							|  |  |  |     PyObject * const *fastargs; | 
					
						
							|  |  |  |     Py_ssize_t nargs = PyTuple_GET_SIZE(args); | 
					
						
							|  |  |  |     PyObject *origin; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 1, 1, 0, argsbuf); | 
					
						
							|  |  |  |     if (!fastargs) { | 
					
						
							|  |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     origin = fastargs[0]; | 
					
						
							|  |  |  |     return_value = paramspeckwargs_new_impl(type, origin); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | exit: | 
					
						
							|  |  |  |     return return_value; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | PyDoc_STRVAR(paramspec_new__doc__, | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  | "paramspec(name, *, bound=None, default=typing.NoDefault,\n" | 
					
						
							|  |  |  | "          covariant=False, contravariant=False, infer_variance=False)\n" | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  | "--\n" | 
					
						
							|  |  |  | "\n" | 
					
						
							|  |  |  | "Create a ParamSpec object."); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | paramspec_new_impl(PyTypeObject *type, PyObject *name, PyObject *bound, | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  |                    PyObject *default_value, int covariant, int contravariant, | 
					
						
							|  |  |  |                    int infer_variance); | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | paramspec_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     PyObject *return_value = NULL; | 
					
						
							|  |  |  |     #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  |     #define NUM_KEYWORDS 6
 | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  |     static struct { | 
					
						
							|  |  |  |         PyGC_Head _this_is_not_used; | 
					
						
							|  |  |  |         PyObject_VAR_HEAD | 
					
						
							|  |  |  |         PyObject *ob_item[NUM_KEYWORDS]; | 
					
						
							|  |  |  |     } _kwtuple = { | 
					
						
							|  |  |  |         .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  |         .ob_item = { &_Py_ID(name), &_Py_ID(bound), &_Py_ID(default), &_Py_ID(covariant), &_Py_ID(contravariant), &_Py_ID(infer_variance), }, | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  |     }; | 
					
						
							|  |  |  |     #undef NUM_KEYWORDS
 | 
					
						
							|  |  |  |     #define KWTUPLE (&_kwtuple.ob_base.ob_base)
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     #else  // !Py_BUILD_CORE
 | 
					
						
							|  |  |  |     #  define KWTUPLE NULL
 | 
					
						
							|  |  |  |     #endif  // !Py_BUILD_CORE
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  |     static const char * const _keywords[] = {"name", "bound", "default", "covariant", "contravariant", "infer_variance", NULL}; | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  |     static _PyArg_Parser _parser = { | 
					
						
							|  |  |  |         .keywords = _keywords, | 
					
						
							|  |  |  |         .fname = "paramspec", | 
					
						
							|  |  |  |         .kwtuple = KWTUPLE, | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     #undef KWTUPLE
 | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  |     PyObject *argsbuf[6]; | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  |     PyObject * const *fastargs; | 
					
						
							|  |  |  |     Py_ssize_t nargs = PyTuple_GET_SIZE(args); | 
					
						
							|  |  |  |     Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 1; | 
					
						
							|  |  |  |     PyObject *name; | 
					
						
							|  |  |  |     PyObject *bound = Py_None; | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  |     PyObject *default_value = &_Py_NoDefaultStruct; | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  |     int covariant = 0; | 
					
						
							|  |  |  |     int contravariant = 0; | 
					
						
							|  |  |  |     int infer_variance = 0; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 1, 1, 0, argsbuf); | 
					
						
							|  |  |  |     if (!fastargs) { | 
					
						
							|  |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     if (!PyUnicode_Check(fastargs[0])) { | 
					
						
							|  |  |  |         _PyArg_BadArgument("paramspec", "argument 'name'", "str", fastargs[0]); | 
					
						
							|  |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     name = fastargs[0]; | 
					
						
							|  |  |  |     if (!noptargs) { | 
					
						
							|  |  |  |         goto skip_optional_kwonly; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     if (fastargs[1]) { | 
					
						
							|  |  |  |         bound = fastargs[1]; | 
					
						
							|  |  |  |         if (!--noptargs) { | 
					
						
							|  |  |  |             goto skip_optional_kwonly; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     if (fastargs[2]) { | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  |         default_value = fastargs[2]; | 
					
						
							|  |  |  |         if (!--noptargs) { | 
					
						
							|  |  |  |             goto skip_optional_kwonly; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     if (fastargs[3]) { | 
					
						
							|  |  |  |         covariant = PyObject_IsTrue(fastargs[3]); | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  |         if (covariant < 0) { | 
					
						
							|  |  |  |             goto exit; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         if (!--noptargs) { | 
					
						
							|  |  |  |             goto skip_optional_kwonly; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  |     if (fastargs[4]) { | 
					
						
							|  |  |  |         contravariant = PyObject_IsTrue(fastargs[4]); | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  |         if (contravariant < 0) { | 
					
						
							|  |  |  |             goto exit; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         if (!--noptargs) { | 
					
						
							|  |  |  |             goto skip_optional_kwonly; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  |     infer_variance = PyObject_IsTrue(fastargs[5]); | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  |     if (infer_variance < 0) { | 
					
						
							|  |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | skip_optional_kwonly: | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  |     return_value = paramspec_new_impl(type, name, bound, default_value, covariant, contravariant, infer_variance); | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | exit: | 
					
						
							|  |  |  |     return return_value; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | PyDoc_STRVAR(paramspec_typing_subst__doc__, | 
					
						
							| 
									
										
										
										
											2023-08-29 17:55:56 +03:00
										 |  |  | "__typing_subst__($self, arg, /)\n" | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  | "--\n" | 
					
						
							|  |  |  | "\n"); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define PARAMSPEC_TYPING_SUBST_METHODDEF    \
 | 
					
						
							| 
									
										
										
										
											2023-08-29 17:55:56 +03:00
										 |  |  |     {"__typing_subst__", (PyCFunction)paramspec_typing_subst, METH_O, paramspec_typing_subst__doc__}, | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | PyDoc_STRVAR(paramspec_typing_prepare_subst__doc__, | 
					
						
							| 
									
										
										
										
											2023-08-29 17:55:56 +03:00
										 |  |  | "__typing_prepare_subst__($self, alias, args, /)\n" | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  | "--\n" | 
					
						
							|  |  |  | "\n"); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define PARAMSPEC_TYPING_PREPARE_SUBST_METHODDEF    \
 | 
					
						
							| 
									
										
										
										
											2023-08-29 17:55:56 +03:00
										 |  |  |     {"__typing_prepare_subst__", _PyCFunction_CAST(paramspec_typing_prepare_subst), METH_FASTCALL, paramspec_typing_prepare_subst__doc__}, | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | paramspec_typing_prepare_subst_impl(paramspecobject *self, PyObject *alias, | 
					
						
							|  |  |  |                                     PyObject *args); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							| 
									
										
										
										
											2023-08-29 17:55:56 +03:00
										 |  |  | paramspec_typing_prepare_subst(paramspecobject *self, PyObject *const *args, Py_ssize_t nargs) | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  | { | 
					
						
							|  |  |  |     PyObject *return_value = NULL; | 
					
						
							|  |  |  |     PyObject *alias; | 
					
						
							|  |  |  |     PyObject *__clinic_args; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-29 17:55:56 +03:00
										 |  |  |     if (!_PyArg_CheckPositional("__typing_prepare_subst__", nargs, 2, 2)) { | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     alias = args[0]; | 
					
						
							|  |  |  |     __clinic_args = args[1]; | 
					
						
							|  |  |  |     return_value = paramspec_typing_prepare_subst_impl(self, alias, __clinic_args); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | exit: | 
					
						
							|  |  |  |     return return_value; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | PyDoc_STRVAR(paramspec_reduce__doc__, | 
					
						
							|  |  |  | "__reduce__($self, /)\n" | 
					
						
							|  |  |  | "--\n" | 
					
						
							|  |  |  | "\n"); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define PARAMSPEC_REDUCE_METHODDEF    \
 | 
					
						
							|  |  |  |     {"__reduce__", (PyCFunction)paramspec_reduce, METH_NOARGS, paramspec_reduce__doc__}, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | paramspec_reduce_impl(paramspecobject *self); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | paramspec_reduce(paramspecobject *self, PyObject *Py_UNUSED(ignored)) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return paramspec_reduce_impl(self); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  | PyDoc_STRVAR(paramspec_has_default__doc__, | 
					
						
							|  |  |  | "has_default($self, /)\n" | 
					
						
							|  |  |  | "--\n" | 
					
						
							|  |  |  | "\n"); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define PARAMSPEC_HAS_DEFAULT_METHODDEF    \
 | 
					
						
							|  |  |  |     {"has_default", (PyCFunction)paramspec_has_default, METH_NOARGS, paramspec_has_default__doc__}, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | paramspec_has_default_impl(paramspecobject *self); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | paramspec_has_default(paramspecobject *self, PyObject *Py_UNUSED(ignored)) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return paramspec_has_default_impl(self); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  | PyDoc_STRVAR(typevartuple__doc__, | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  | "typevartuple(name, *, default=typing.NoDefault)\n" | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  | "--\n" | 
					
						
							|  |  |  | "\n" | 
					
						
							|  |  |  | "Create a new TypeVarTuple with the given name."); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  | typevartuple_impl(PyTypeObject *type, PyObject *name, | 
					
						
							|  |  |  |                   PyObject *default_value); | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | typevartuple(PyTypeObject *type, PyObject *args, PyObject *kwargs) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     PyObject *return_value = NULL; | 
					
						
							|  |  |  |     #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  |     #define NUM_KEYWORDS 2
 | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  |     static struct { | 
					
						
							|  |  |  |         PyGC_Head _this_is_not_used; | 
					
						
							|  |  |  |         PyObject_VAR_HEAD | 
					
						
							|  |  |  |         PyObject *ob_item[NUM_KEYWORDS]; | 
					
						
							|  |  |  |     } _kwtuple = { | 
					
						
							|  |  |  |         .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  |         .ob_item = { &_Py_ID(name), &_Py_ID(default), }, | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  |     }; | 
					
						
							|  |  |  |     #undef NUM_KEYWORDS
 | 
					
						
							|  |  |  |     #define KWTUPLE (&_kwtuple.ob_base.ob_base)
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     #else  // !Py_BUILD_CORE
 | 
					
						
							|  |  |  |     #  define KWTUPLE NULL
 | 
					
						
							|  |  |  |     #endif  // !Py_BUILD_CORE
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  |     static const char * const _keywords[] = {"name", "default", NULL}; | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  |     static _PyArg_Parser _parser = { | 
					
						
							|  |  |  |         .keywords = _keywords, | 
					
						
							|  |  |  |         .fname = "typevartuple", | 
					
						
							|  |  |  |         .kwtuple = KWTUPLE, | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     #undef KWTUPLE
 | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  |     PyObject *argsbuf[2]; | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  |     PyObject * const *fastargs; | 
					
						
							|  |  |  |     Py_ssize_t nargs = PyTuple_GET_SIZE(args); | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  |     Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 1; | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  |     PyObject *name; | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  |     PyObject *default_value = &_Py_NoDefaultStruct; | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |     fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 1, 1, 0, argsbuf); | 
					
						
							|  |  |  |     if (!fastargs) { | 
					
						
							|  |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     if (!PyUnicode_Check(fastargs[0])) { | 
					
						
							|  |  |  |         _PyArg_BadArgument("typevartuple", "argument 'name'", "str", fastargs[0]); | 
					
						
							|  |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     name = fastargs[0]; | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  |     if (!noptargs) { | 
					
						
							|  |  |  |         goto skip_optional_kwonly; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     default_value = fastargs[1]; | 
					
						
							|  |  |  | skip_optional_kwonly: | 
					
						
							|  |  |  |     return_value = typevartuple_impl(type, name, default_value); | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | exit: | 
					
						
							|  |  |  |     return return_value; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | PyDoc_STRVAR(typevartuple_typing_subst__doc__, | 
					
						
							| 
									
										
										
										
											2023-08-29 17:55:56 +03:00
										 |  |  | "__typing_subst__($self, arg, /)\n" | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  | "--\n" | 
					
						
							|  |  |  | "\n"); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define TYPEVARTUPLE_TYPING_SUBST_METHODDEF    \
 | 
					
						
							| 
									
										
										
										
											2023-08-29 17:55:56 +03:00
										 |  |  |     {"__typing_subst__", (PyCFunction)typevartuple_typing_subst, METH_O, typevartuple_typing_subst__doc__}, | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | PyDoc_STRVAR(typevartuple_typing_prepare_subst__doc__, | 
					
						
							| 
									
										
										
										
											2023-08-29 17:55:56 +03:00
										 |  |  | "__typing_prepare_subst__($self, alias, args, /)\n" | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  | "--\n" | 
					
						
							|  |  |  | "\n"); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define TYPEVARTUPLE_TYPING_PREPARE_SUBST_METHODDEF    \
 | 
					
						
							| 
									
										
										
										
											2023-08-29 17:55:56 +03:00
										 |  |  |     {"__typing_prepare_subst__", _PyCFunction_CAST(typevartuple_typing_prepare_subst), METH_FASTCALL, typevartuple_typing_prepare_subst__doc__}, | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | typevartuple_typing_prepare_subst_impl(typevartupleobject *self, | 
					
						
							|  |  |  |                                        PyObject *alias, PyObject *args); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							| 
									
										
										
										
											2023-08-29 17:55:56 +03:00
										 |  |  | typevartuple_typing_prepare_subst(typevartupleobject *self, PyObject *const *args, Py_ssize_t nargs) | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  | { | 
					
						
							|  |  |  |     PyObject *return_value = NULL; | 
					
						
							|  |  |  |     PyObject *alias; | 
					
						
							|  |  |  |     PyObject *__clinic_args; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-29 17:55:56 +03:00
										 |  |  |     if (!_PyArg_CheckPositional("__typing_prepare_subst__", nargs, 2, 2)) { | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     alias = args[0]; | 
					
						
							|  |  |  |     __clinic_args = args[1]; | 
					
						
							|  |  |  |     return_value = typevartuple_typing_prepare_subst_impl(self, alias, __clinic_args); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | exit: | 
					
						
							|  |  |  |     return return_value; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | PyDoc_STRVAR(typevartuple_reduce__doc__, | 
					
						
							|  |  |  | "__reduce__($self, /)\n" | 
					
						
							|  |  |  | "--\n" | 
					
						
							|  |  |  | "\n"); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define TYPEVARTUPLE_REDUCE_METHODDEF    \
 | 
					
						
							|  |  |  |     {"__reduce__", (PyCFunction)typevartuple_reduce, METH_NOARGS, typevartuple_reduce__doc__}, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | typevartuple_reduce_impl(typevartupleobject *self); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | typevartuple_reduce(typevartupleobject *self, PyObject *Py_UNUSED(ignored)) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return typevartuple_reduce_impl(self); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  | PyDoc_STRVAR(typevartuple_has_default__doc__, | 
					
						
							|  |  |  | "has_default($self, /)\n" | 
					
						
							|  |  |  | "--\n" | 
					
						
							|  |  |  | "\n"); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define TYPEVARTUPLE_HAS_DEFAULT_METHODDEF    \
 | 
					
						
							|  |  |  |     {"has_default", (PyCFunction)typevartuple_has_default, METH_NOARGS, typevartuple_has_default__doc__}, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | typevartuple_has_default_impl(typevartupleobject *self); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | typevartuple_has_default(typevartupleobject *self, PyObject *Py_UNUSED(ignored)) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return typevartuple_has_default_impl(self); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-15 20:36:23 -07:00
										 |  |  | PyDoc_STRVAR(typealias_reduce__doc__, | 
					
						
							|  |  |  | "__reduce__($self, /)\n" | 
					
						
							|  |  |  | "--\n" | 
					
						
							|  |  |  | "\n"); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define TYPEALIAS_REDUCE_METHODDEF    \
 | 
					
						
							|  |  |  |     {"__reduce__", (PyCFunction)typealias_reduce, METH_NOARGS, typealias_reduce__doc__}, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | typealias_reduce_impl(typealiasobject *self); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | typealias_reduce(typealiasobject *self, PyObject *Py_UNUSED(ignored)) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return typealias_reduce_impl(self); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | PyDoc_STRVAR(typealias_new__doc__, | 
					
						
							|  |  |  | "typealias(name, value, *, type_params=<unrepresentable>)\n" | 
					
						
							|  |  |  | "--\n" | 
					
						
							|  |  |  | "\n" | 
					
						
							|  |  |  | "Create a TypeAliasType."); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | typealias_new_impl(PyTypeObject *type, PyObject *name, PyObject *value, | 
					
						
							|  |  |  |                    PyObject *type_params); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | typealias_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     PyObject *return_value = NULL; | 
					
						
							|  |  |  |     #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     #define NUM_KEYWORDS 3
 | 
					
						
							|  |  |  |     static struct { | 
					
						
							|  |  |  |         PyGC_Head _this_is_not_used; | 
					
						
							|  |  |  |         PyObject_VAR_HEAD | 
					
						
							|  |  |  |         PyObject *ob_item[NUM_KEYWORDS]; | 
					
						
							|  |  |  |     } _kwtuple = { | 
					
						
							|  |  |  |         .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) | 
					
						
							|  |  |  |         .ob_item = { &_Py_ID(name), &_Py_ID(value), &_Py_ID(type_params), }, | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     #undef NUM_KEYWORDS
 | 
					
						
							|  |  |  |     #define KWTUPLE (&_kwtuple.ob_base.ob_base)
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     #else  // !Py_BUILD_CORE
 | 
					
						
							|  |  |  |     #  define KWTUPLE NULL
 | 
					
						
							|  |  |  |     #endif  // !Py_BUILD_CORE
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     static const char * const _keywords[] = {"name", "value", "type_params", NULL}; | 
					
						
							|  |  |  |     static _PyArg_Parser _parser = { | 
					
						
							|  |  |  |         .keywords = _keywords, | 
					
						
							|  |  |  |         .fname = "typealias", | 
					
						
							|  |  |  |         .kwtuple = KWTUPLE, | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     #undef KWTUPLE
 | 
					
						
							|  |  |  |     PyObject *argsbuf[3]; | 
					
						
							|  |  |  |     PyObject * const *fastargs; | 
					
						
							|  |  |  |     Py_ssize_t nargs = PyTuple_GET_SIZE(args); | 
					
						
							|  |  |  |     Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 2; | 
					
						
							|  |  |  |     PyObject *name; | 
					
						
							|  |  |  |     PyObject *value; | 
					
						
							|  |  |  |     PyObject *type_params = NULL; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 2, 2, 0, argsbuf); | 
					
						
							|  |  |  |     if (!fastargs) { | 
					
						
							|  |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     if (!PyUnicode_Check(fastargs[0])) { | 
					
						
							|  |  |  |         _PyArg_BadArgument("typealias", "argument 'name'", "str", fastargs[0]); | 
					
						
							|  |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     name = fastargs[0]; | 
					
						
							|  |  |  |     value = fastargs[1]; | 
					
						
							|  |  |  |     if (!noptargs) { | 
					
						
							|  |  |  |         goto skip_optional_kwonly; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     type_params = fastargs[2]; | 
					
						
							|  |  |  | skip_optional_kwonly: | 
					
						
							|  |  |  |     return_value = typealias_new_impl(type, name, value, type_params); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | exit: | 
					
						
							|  |  |  |     return return_value; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2024-05-03 06:17:32 -07:00
										 |  |  | /*[clinic end generated code: output=73b39e550e4e336c input=a9049054013a1b77]*/ |