Nick Coghlan added the comment:

The problem with adding new APIs with different names to the JSON module is 
that it breaks symmetry with other wire protocols. The quartet of module level 
load, loads, dump and dumps functions has become a de facto standard API for 
wire protocols.

If it wasn't for that API convention, the status quo would be substantially 
less annoying (and confusing) than it currently is.

The advantage of a separate "jsonb" module is that it becomes easy to say "json 
is the text transform that dumps and loads from a Unicode string, jsonb is the 
wire protocol that dumps and loads a UTF encoded byte sequence".

Backporting as simplejsonb would also work in a straightforward fashion (since 
one PyPI package can include multiple top level Python modules).

The same approach would also extend to fixing the xmlrpc module to handle the 
encoding step properly (if anyone was so inclined).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19837>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to