开发者

How to default to CLoader in PyYaml.load

Is 开发者_如何学Gothere any way to have the default loader for PyYaml be CLoader. So instead of having to do

yaml.load(f, Loader=yaml.CLoader)

It would just default to CLoader, so I could do:

yaml.load(f)


I think what you are looking for is functools.partial:

import functools

myload=functools.partial(yaml.load,Loader=yaml.CLoader)
myload(f)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜