@@ -443,6 +443,7 @@ writer_write_repr(PyObject *self_raw, PyObject *args)
443443 if (!PyArg_ParseTuple (args , "O" , & obj )) {
444444 return NULL ;
445445 }
446+ NULLABLE (obj );
446447
447448 if (PyUnicodeWriter_WriteRepr (self -> writer , obj ) < 0 ) {
448449 return NULL ;
@@ -451,6 +452,23 @@ writer_write_repr(PyObject *self_raw, PyObject *args)
451452}
452453
453454
455+ static PyObject *
456+ writer_write_repr_true (PyObject * self_raw , PyObject * obj )
457+ {
458+ WriterObject * self = (WriterObject * )self_raw ;
459+ if (writer_check (self ) < 0 ) {
460+ return NULL ;
461+ }
462+
463+ NULLABLE (obj );
464+
465+ if (_PyUnicodeWriter_WriteReprTrue (self -> writer , obj ) < 0 ) {
466+ return NULL ;
467+ }
468+ Py_RETURN_NONE ;
469+ }
470+
471+
454472static PyObject *
455473writer_write_substring (PyObject * self_raw , PyObject * args )
456474{
@@ -539,6 +557,7 @@ static PyMethodDef writer_methods[] = {
539557 {"write_ucs4" , _PyCFunction_CAST (writer_write_ucs4 ), METH_VARARGS },
540558 {"write_str" , _PyCFunction_CAST (writer_write_str ), METH_VARARGS },
541559 {"write_repr" , _PyCFunction_CAST (writer_write_repr ), METH_VARARGS },
560+ {"write_repr_true" , _PyCFunction_CAST (writer_write_repr_true ), METH_O },
542561 {"write_substring" , _PyCFunction_CAST (writer_write_substring ), METH_VARARGS },
543562 {"decodeutf8stateful" , _PyCFunction_CAST (writer_decodeutf8stateful ), METH_VARARGS },
544563 {"get_pointer" , _PyCFunction_CAST (writer_get_pointer ), METH_VARARGS },
0 commit comments