Message204978
> 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. |
|
Date |
User |
Action |
Args |
2013-12-01 23:19:29 | pitrou | set | recipients:
+ pitrou, barry, chrism, ncoghlan, serhiy.storchaka |
2013-12-01 23:19:29 | pitrou | link | issue19837 messages |
2013-12-01 23:19:29 | pitrou | create | |
|