Yes, all cool. But, json.dump(Opts.__dict__, open("mybuffer", "w"))
still doesn't work with python3. Returns "is not JSON serializable" On Sun, Dec 10, 2017 at 4:00 AM, Steve D'Aprano <steve+pyt...@pearwood.info> wrote: > On Sun, 10 Dec 2017 04:52 am, MRAB wrote: > > > Try updating __dict__: > > > > Opts.__dict__.update(json.load(open("mybuffer"))) > > __dict__ is implementation, vars() is the public interface: > > vars(Opts).update(json.load(open("mybuffer"))) > > > Looks nicer too :-) > > > > > -- > Steve > “Cheer up,” they said, “things could be worse.” So I cheered up, and sure > enough, things got worse. > > -- > https://mail.python.org/mailman/listinfo/python-list > -- **** Listen to my FREE CD at http://www.mellowood.ca/music/cedars **** Bob van der Poel ** Wynndel, British Columbia, CANADA ** EMAIL: b...@mellowood.ca WWW: http://www.mellowood.ca -- https://mail.python.org/mailman/listinfo/python-list