Modify ↓
Ticket #24 (closed defect: worksforme)
dictionaries without at least one list element as values seem not to work
| Reported by: | anonymous | Owned by: | xi |
|---|---|---|---|
| Priority: | normal | Component: | pyyaml |
| Severity: | normal | Keywords: | |
| Cc: |
Description
>>> print yaml.dump({'name': 'Silenthand Olleander', 'race': 'Human', 'traits': 1})
{traits: 1, race: Human, name: Silenthand Olleander}
>>> print yaml.dump({'name': 'Silenthand Olleander', 'race': 'Human', 'traits': [1,2]})
traits: [1, 2]
race: Human
name: Silenthand Olleander
it seems without a list as at least one value element in dict the dump is not working properly
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

First, it's not a bug. Second, it's 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