diff options
author | Anthon van der Neut <anthon@mnt.org> | 2017-06-06 20:55:19 +0200 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2017-06-06 20:55:19 +0200 |
commit | 7fcb11d7af77110fb5e3eea90cdebf108dcfe480 (patch) | |
tree | 9a083db212d76b67b7ab3d2f445839bb1d6e3f07 /_doc | |
parent | e229dcc4746db742ece545c46e708afe1c3f0945 (diff) | |
download | ruamel.yaml-7fcb11d7af77110fb5e3eea90cdebf108dcfe480.tar.gz |
added first warning explanation
Diffstat (limited to '_doc')
-rw-r--r-- | _doc/api.rst | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/_doc/api.rst b/_doc/api.rst index 1d4a1ec..512d726 100644 --- a/_doc/api.rst +++ b/_doc/api.rst @@ -72,6 +72,31 @@ Initially only the typical operations are supported, but in principle all functionality of the old interface will be available via ``YAML`` instances (if you are using something that isn't let me know). +Loading +------- + +Duplicate keys +++++++++++++++ + +In JSON mapping keys should be unique, in YAML they must be unique. +PyYAML never enforced this although the YAML 1.1 specification already +required this. + +In the new API (starting 0.15.1) duplicate keys in mappings are no longer allowed by +default. To allow duplicate keys in mappings:: + + yaml = ruamel.yaml.YAML() + yaml.allow_duplicate_keys = True + yaml.load(stream) + +In the old API this is a warning starting with 0.15.2 and an error in +0.16.0. + +Dumping +------- + + + Transparent usage of new and old API ------------------------------------ |