From: Karol L. <kar...@kn...> - 2007-11-19 15:22:19
|
On Monday 19 November 2007 15:56, Noel O'Boyle wrote: > > > How about > > > changing so that rather than passing in a module, you just pass in the > > > dump/load function? Then cclib wouldn't have to do any of this. The > > > user would do "from simplejson import dumps", and then pass "dumps" as > > > a parameter to write_json. > > > > I'm not sure I understand: you propose to bundle a pure python JSON > > module for the default (simplejson or json), and add an optional > > dumps/loads argument if the user wants an alternate function? > > Maybe - what do you think? Alternatively, we could forget about > bundling or importing the module ourselves, and just leave it to the > user to pass in the dumps/loads function. This would make our code > much cleaner, and fits the "Only one good way to do it" philosophy of > Python. I will go with this as my final proposal... I have no definite opinion. If there is no actual JSON support in cclib (bundled or imported), then there's no point in having a 'writejson' method is there? Just an ambigious 'write' method, since you can pass a function that does _anything_. Karol -- written by Karol Langner Mon Nov 19 16:22:20 CET 2007 |