Subclass all base classes from `object`.
commit728d62da5c3915c4c2d76a00c93cfae031639391
authorxi <xi@18f92427-320e-0410-9341-c67f048884a3>
Thu, 3 Aug 2006 16:07:29 +0000 (3 16:07 +0000)
committerxi <xi@18f92427-320e-0410-9341-c67f048884a3>
Thu, 3 Aug 2006 16:07:29 +0000 (3 16:07 +0000)
tree07db11c9a08e9a4790c04a86fbc7d47db61b12be
parent9459ede7f9520011e44371c98a9d6173bfeb7cf6
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)`
now.

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.

git-svn-id: http://svn.pyyaml.org/pyyaml/trunk@222 18f92427-320e-0410-9341-c67f048884a3
32 files changed:
lib/yaml/composer.py
lib/yaml/constructor.py
lib/yaml/emitter.py
lib/yaml/error.py
lib/yaml/events.py
lib/yaml/nodes.py
lib/yaml/parser.py
lib/yaml/reader.py
lib/yaml/representer.py
lib/yaml/resolver.py
lib/yaml/scanner.py
lib/yaml/serializer.py
lib/yaml/tokens.py
tests/data/duplicate-key.former-loader-error.code [new file with mode: 0644]
tests/data/duplicate-key.former-loader-error.data [moved from tests/data/duplicate-key.loader-error with 100% similarity]
tests/data/duplicate-mapping-key.former-loader-error.code [new file with mode: 0644]
tests/data/duplicate-mapping-key.former-loader-error.data [moved from tests/data/duplicate-mapping-key.loader-error with 100% similarity]
tests/data/duplicate-merge-key.former-loader-error.code [new file with mode: 0644]
tests/data/duplicate-merge-key.former-loader-error.data [moved from tests/data/duplicate-merge-key.loader-error with 100% similarity]
tests/data/duplicate-value-key.former-loader-error.code [new file with mode: 0644]
tests/data/duplicate-value-key.former-loader-error.data [moved from tests/data/duplicate-value-key.loader-error with 100% similarity]
tests/data/recurive-list.recursive [new file with mode: 0644]
tests/data/recursive-anchor.former-loader-error [moved from tests/data/recursive-anchor.loader-error with 100% similarity]
tests/data/recursive-dict.recursive [new file with mode: 0644]
tests/data/recursive-set.recursive [new file with mode: 0644]
tests/data/recursive-state.recursive [new file with mode: 0644]
tests/data/recursive-tuple.recursive [new file with mode: 0644]
tests/data/recursive.former-dumper-error [moved from tests/data/recursive.dumper-error with 100% similarity]
tests/test_constructor.py
tests/test_recursive.py
tests/test_resolver.py
tests/test_structure.py