Changes between Initial Version and Version 1 of Ticket #18


Ignore:
Timestamp:
07/06/06 16:31:14 (8 years ago)
Author:
xi
Comment:

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

>>> print yaml.dump(data, default_flow_style=False)
b:
  bb: 2
  ba: 1
a: 1

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #18

    • Property Status changed from new to closed
    • Property Resolution changed from to worksforme
  • Ticket #18 – Description

    initial v1  
     1{{{ 
     2#!python 
    13import yaml 
    24data=yaml.load(""" 
     
    79""") 
    810yaml.dump(data) 
    9  
     11}}} 
    1012[gives] 
    11  
     13{{{ 
     14#!python 
    1215 'a: 1\nb: {ba: 1, bb: 2}\n' 
    13  
     16}}} 
    1417pyYaml 3.0.3 - Python 2.4.3 - Windows XP 
    15      
     18