Content-Length: 327492 | pFad | http://github.com/python/cpython/pull/136441/files/d733d110b60e25e8fc6dbf65db51acfb0832f370

B7 gh-132661: Add default value (of `""`) for `Interpolation.expression` by davepeck · Pull Request #136441 · python/cpython · GitHub
Skip to content

gh-132661: Add default value (of "") for Interpolation.expression #136441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 10, 2025
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
``Interpolation.expression`` now has a default, the empty string.
23 changes: 14 additions & 9 deletions Objects/clinic/interpolationobject.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Objects/interpolationobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]*/
Expand All @@ -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) {
Expand Down
Loading








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/python/cpython/pull/136441/files/d733d110b60e25e8fc6dbf65db51acfb0832f370

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy