mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-110907: AC: Disallow using *
with vararg (#110908)
This commit is contained in:
parent
14d2d1576d
commit
bad7a35055
4 changed files with 26 additions and 4 deletions
4
Objects/clinic/typevarobject.c.h
generated
4
Objects/clinic/typevarobject.c.h
generated
|
@ -8,7 +8,7 @@ preserve
|
|||
#endif
|
||||
|
||||
PyDoc_STRVAR(typevar_new__doc__,
|
||||
"typevar(name, *constraints, *, bound=None, covariant=False,\n"
|
||||
"typevar(name, *constraints, bound=None, covariant=False,\n"
|
||||
" contravariant=False, infer_variance=False)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
|
@ -590,4 +590,4 @@ skip_optional_kwonly:
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=db0b327ebbb1488f input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=027fb8cbef6e5015 input=a9049054013a1b77]*/
|
||||
|
|
|
@ -327,7 +327,6 @@ typevar.__new__ as typevar_new
|
|||
|
||||
name: object(subclass_of="&PyUnicode_Type")
|
||||
*constraints: object
|
||||
*
|
||||
bound: object = None
|
||||
covariant: bool = False
|
||||
contravariant: bool = False
|
||||
|
@ -340,7 +339,7 @@ static PyObject *
|
|||
typevar_new_impl(PyTypeObject *type, PyObject *name, PyObject *constraints,
|
||||
PyObject *bound, int covariant, int contravariant,
|
||||
int infer_variance)
|
||||
/*[clinic end generated code: output=1d200450ee99226d input=2c07ab87c94f462b]*/
|
||||
/*[clinic end generated code: output=1d200450ee99226d input=41ae33a916bfe76f]*/
|
||||
{
|
||||
if (covariant && contravariant) {
|
||||
PyErr_SetString(PyExc_ValueError,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue