[issue14886] json C vs pure-python implementation difference

Марк Коренберг report at bugs.python.org
Wed May 23 11:25:29 CEST 2012


New submission from Марк Коренберг <socketpair at gmail.com>:

Pure-python implementation:
    if isinstance(o, (list, tuple)):

C implementation:
    if (PyList_Check(obj) || PyTuple_Check(obj))

This make real difference (!) in my code.

So, please change pure-python implementation to:
    if type(o) in (list, tuple):
Or, fix C implementation to: /* intentionally forgot (only for this example) to check if return value is -1 */
    if (PyObject_IsInstance(obj, PyList_Type) || PyObject_IsInstance(obj, PyTuple_Type)

----------
components: Library (Lib)
messages: 161395
nosy: mmarkk
priority: normal
severity: normal
status: open
title: json C vs pure-python implementation difference
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14886>
_______________________________________


More information about the Python-bugs-list mailing list