package python; import python.lib.Dict; abstract KwArgs (Dict) { inline function new (d:Dict) this = d; @:to public inline function toDict ():Dict { return this; } @:from static inline function fromDict (d:Dict):KwArgs { return new KwArgs(d); } @:from static inline function fromT (d:T):KwArgs { return new KwArgs(Lib.anonAsDict(d)); } public function typed ():T { return Lib.dictAsAnon(toDict()); } public function get (key:String, def:V):V { return this.get(key, def); } }