@@ -510,6 +510,27 @@ writer_finish(PyObject *self_raw, PyObject *Py_UNUSED(args))
510
510
}
511
511
512
512
513
+ static PyObject *
514
+ writer_fill (PyObject * self_raw , PyObject * args )
515
+ {
516
+ WriterObject * self = (WriterObject * )self_raw ;
517
+ if (writer_check (self ) < 0 ) {
518
+ return NULL ;
519
+ }
520
+
521
+ Py_ssize_t len ;
522
+ int ch ;
523
+ if (!PyArg_ParseTuple (args , "nC" , & len , & ch )) {
524
+ return NULL ;
525
+ }
526
+
527
+ if (PyUnicodeWriter_Fill (self -> writer , len , ch ) < 0 ) {
528
+ return NULL ;
529
+ }
530
+ Py_RETURN_NONE ;
531
+ }
532
+
533
+
513
534
static PyMethodDef writer_methods [] = {
514
535
{"write_char" , _PyCFunction_CAST (writer_write_char ), METH_VARARGS },
515
536
{"write_utf8" , _PyCFunction_CAST (writer_write_utf8 ), METH_VARARGS },
@@ -519,6 +540,7 @@ static PyMethodDef writer_methods[] = {
519
540
{"write_repr" , _PyCFunction_CAST (writer_write_repr ), METH_VARARGS },
520
541
{"write_substring" , _PyCFunction_CAST (writer_write_substring ), METH_VARARGS },
521
542
{"decodeutf8stateful" , _PyCFunction_CAST (writer_decodeutf8stateful ), METH_VARARGS },
543
+ {"fill" , _PyCFunction_CAST (writer_fill ), METH_VARARGS },
522
544
{"get_pointer" , _PyCFunction_CAST (writer_get_pointer ), METH_VARARGS },
523
545
{"finish" , _PyCFunction_CAST (writer_finish ), METH_NOARGS },
524
546
{NULL , NULL } /* sentinel */
0 commit comments