source: pyyaml/trunk/tests/data/ @ 222

Revision 222, 97 bytes checked in by xi, 11 years ago (diff)

Subclass all base classes from object.

Hold references to the objects being represented (should fix #22).

The value of a mapping node is represented as a list of pairs (key, value)

Sort dictionary items (fix #23).

Recursive structures are now loaded and dumped correctly, including complex
structures like recursive tuples (fix #5). Thanks Peter Murphy for the patches.
To make it possible, representer functions are allowed to be generators.
In this case, the first generated value is an object. Other values produced
by the representer are ignored.

Make Representer not try to guess !!pairs when a list is represented.
You need to construct a !!pairs node explicitly now.

Do not check for duplicate mapping keys as it didn't work correctly anyway.

2&anchor foo:
3    foo: bar
4    *anchor: duplicate key
5    baz: bat
6    *anchor: duplicate key
Note: See TracBrowser for help on using the repository browser.