gh-110907: AC: Disallow using * with vararg (#110908)

This commit is contained in:
Nikita Sobolev 2023-10-16 17:26:11 +03:00 committed by GitHub
parent 14d2d1576d
commit bad7a35055
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 4 deletions

View file

@ -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]*/

View file

@ -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,