views:

16

answers:

1

Is there 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)
A: 

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

import functools

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