Custom Query (121 matches)
Results (85 - 87 of 121)
|#115||fixed||Initialisation not ANSI compliant||xi||nothingmuch@…|
Supplied is a patch that hopefully resolves this issue.
|#116||fixed||the order of keys is important||xi||Andrey Somov <py4fun@…>|
When PyYAML is run on alternative VM (jython for instance) the order of the dictionary keys may be different. Unfortunately PyYAML relies on the order in some cases. The attached patches show that tests fail only when the sequence of the keys is reversed. These cases were found under Java 5. (for Java 6 the order is the same as for CPython). To avoid unexpected bugs in future it would be safe to change the implementation to use a kind of an ordered dictionary.(or to respect the order in some other way). There is no guarantee the list is complete. This is just a coincidence it was found.
I dont understand how PyYAML reads YML files with "Block Mapping", (I call these "Nested variables" in my example):
>>> document = """ Variable 1: x: a y: b z: c Variable 2: 1: a 2: b 3: c """ >>> yml=yaml.load(document) >>> yml.keys() ['Variable 2', 'Variable 1'] >>> yml["Variable 1"].keys() ['y', 'x', 'z']
So it looks like PyYAML loads the document in reverse order, "Variable 2" is read before "Variable 1". That's fine. But why is ymlVariable 1?.keys() in a random order? It seems like it should either be chronological (x,y,z) or reverse chronological (z,y,x).
PS: Sorry if this is the wrong place for a question... I couldn't find a mailing list.