Lines Matching defs:obj

103 encoder_listencode_obj(PyEncoderObject *s, _PyAccu *acc, PyObject *obj, Py_ssize_t indent_level);
107 _encoded_const(PyObject *obj);
111 encoder_encode_string(PyEncoderObject *s, PyObject *obj);
113 encoder_encode_float(PyEncoderObject *s, PyObject *obj);
1295 static char *kwlist[] = {"obj", "_current_indent_level", NULL};
1296 PyObject *obj;
1300 &obj, &indent_level))
1304 if (encoder_listencode_obj(self, &acc, obj, indent_level)) {
1312 _encoded_const(PyObject *obj)
1315 if (obj == Py_None) {
1323 else if (obj == Py_True) {
1331 else if (obj == Py_False) {
1346 encoder_encode_float(PyEncoderObject *s, PyObject *obj)
1349 double i = PyFloat_AS_DOUBLE(obj);
1368 return PyFloat_Type.tp_repr(obj);
1372 encoder_encode_string(PyEncoderObject *s, PyObject *obj)
1378 return s->fast_encode(NULL, obj);
1380 encoded = PyObject_CallOneArg(s->encoder, obj);
1402 PyObject *obj, Py_ssize_t indent_level)
1404 /* Encode Python object obj to a JSON term */
1408 if (obj == Py_None || obj == Py_True || obj == Py_False) {
1409 PyObject *cstr = _encoded_const(obj);
1414 else if (PyUnicode_Check(obj))
1416 PyObject *encoded = encoder_encode_string(s, obj);
1421 else if (PyLong_Check(obj)) {
1422 PyObject *encoded = PyLong_Type.tp_repr(obj);
1427 else if (PyFloat_Check(obj)) {
1428 PyObject *encoded = encoder_encode_float(s, obj);
1433 else if (PyList_Check(obj) || PyTuple_Check(obj)) {
1436 rv = encoder_listencode_list(s, acc, obj, indent_level);
1440 else if (PyDict_Check(obj)) {
1443 rv = encoder_listencode_dict(s, acc, obj, indent_level);
1451 ident = PyLong_FromVoidPtr(obj);
1461 if (PyDict_SetItem(s->markers, ident, obj)) {
1466 newobj = PyObject_CallOneArg(s->defaultfn, obj);
1707 PyObject *obj = PySequence_Fast_GET_ITEM(s_fast, i);
1712 if (encoder_listencode_obj(s, acc, obj, indent_level))
1775 PyDoc_STRVAR(encoder_doc, "_iterencode(obj, _current_indent_level) -> iterable");