Modify ↓
Ticket #27 (closed defect: worksforme)
yaml.dump seems to be broken
| Reported by: | anonymous | Owned by: | xi |
|---|---|---|---|
| Priority: | normal | Component: | pyyaml |
| Severity: | normal | Keywords: | |
| Cc: |
Description
I may be missing something here, but this seems to be broken:
Example that works:
>>> print yaml.dump({'name': "The Cloak 'Colluin'", 'depth': 5, 'rarity': 45, 'weight': 10, 'cost': 50000, 'flags': ['INT', 'WIS', 'SPEED', 'STEALTH']}) cost: 50000 depth: 5 flags: [INT, WIS, SPEED, STEALTH] name: The Cloak 'Colluin' rarity: 45 weight: 10
Portion of above example:
>>> print yaml.dump({'name': "The Cloak 'Colluin'", 'depth': 5}) {depth: 5, name: The Cloak 'Colluin'}
I would expect to get:
depth: 5 name: The Cloak 'Colluin'
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

Duplicate of #18.
It's a correct output despite the fact that the style of the nested mapping is different.
If you want collections to be always serialized in a block style, try