Antoine Pitrou added the comment: > The parallel API would have to be: > > json.dump_bytes > json.dumps_bytes > json.load_bytes > json.loads_bytes
No, only one function dump_bytes() is needed, and it would return a bytes object ("dumps" meaning "dump string", already). loads() can be polymorphic without creating a new function. I don't think the functions taking file objects are used often enough to warrant a second API to deal with binary files. > It doesn't need to be documented as a completely separate module, it can > just be a subsection in the json module docs with a reference to the > relevant RFC. It's still completely weird and unusual. > "Namespaces are a honking great idea; let's do more of those" And also "flat is better than nested". Especially when you're proposing than one API be at level N, and the other, closely related API be at level N+1. ---------- _______________________________________ 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