Fixed in [176].
When a mapping node cannot be correctly represented as a dictionary, PySyck is supposed to convert it to a list of pairs. So in this case, the expected value is
>>> syck.load('foo: bar\nfoo2: bar\nfoo: bar')
[('foo2', 'bar'), ('foo', 'bar'), ('foo', 'bar')]
I fixed the bug and now PySyck works as above.
But now I doubt if it's really a correct fix. The spec claims that a duplicate key in a mapping is an error. It's hard to check in all cases, but PyYAML tries to enforce it:
>>> yaml.load('foo: bar\nfoo2: bar\nfoo: bar')
Traceback (most recent call last):
[...]
yaml.constructor.ConstructorError: while constructing a mapping
in "<string>", line 1, column 1:
foo: bar
^
found duplicate key
in "<string>", line 3, column 1:
foo: bar
^
So you shouldn't really use duplicate keys as they may cause an error in the next versions of PySyck.