[3.14] gh-132661: Add default value (of "") for Interpolation.expression (GH-136441) (#136511)

Co-authored-by: Dave Peck <davepeck@gmail.com>
This commit is contained in:
Miss Islington (bot) 2025-07-10 16:52:18 +02:00 committed by GitHub
parent da8bcfd949
commit 95baa28d9f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 58 additions and 27 deletions

View file

@ -54,7 +54,7 @@ typedef struct {
Interpolation.__new__ as interpolation_new
value: object
expression: object(subclass_of='&PyUnicode_Type')
expression: object(subclass_of='&PyUnicode_Type', c_default='&_Py_STR(empty)') = ""
conversion: object(converter='_conversion_converter') = None
format_spec: object(subclass_of='&PyUnicode_Type', c_default='&_Py_STR(empty)') = ""
[clinic start generated code]*/
@ -63,7 +63,7 @@ static PyObject *
interpolation_new_impl(PyTypeObject *type, PyObject *value,
PyObject *expression, PyObject *conversion,
PyObject *format_spec)
/*[clinic end generated code: output=6488e288765bc1a9 input=d91711024068528c]*/
/*[clinic end generated code: output=6488e288765bc1a9 input=fc5c285c1dd23d36]*/
{
interpolationobject *self = PyObject_GC_New(interpolationobject, type);
if (!self) {