lisa-lab/pylearn2

yaml_parse.py again

Closed this issue · 3 comments

TNick commented

These lines:

construct_mapping(node)
mapping = loader.construct_mapping(node)

should probably be collapsed to

mapping = construct_mapping(node)

Right?

So, the first construct_mapping performs additional checks compared to loader.construct_mapping, which would let things like duplicated keys slip silently.
I think an earlier version of that code would replace loader.construct_mapping by construct_mapping, I'm not sure what changed since then. Maybe the mapping returned by both method is actually different, I'll have to investigate. If they're the same, then yes, your change makes sense.
Actually, that change may be why duplicated keys are not detected in some cases reported some time ago to the mailing list... In that case maybe we should restore that line.

@dwf Do you remember why that was changed during the integration of #705?

TNick commented

Implemented on TNick/pyl2extra
Closing this issue.