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

Reply via email to