creating yaml without tags using pyyaml

Kirill Simonov xi at gamma.dn.ua
Fri Jun 6 14:20:16 CEST 2008


Stephen Moore wrote:
> I have come to the conclusion that this is the fault of the tags (for
> example, !!python/tuple) as getting rid of them gets rid of the
> errors.
> 
> So I'm wondering if there is an option to YAML.decode that will create
> a yaml document without the tags?

Try yaml.safe_dump().

 >>> import yaml

 >>> print yaml.dump(())
!!python/tuple []

 >>> print yaml.safe_dump(())
[]


Thanks,
Kirill



More information about the Python-list mailing list