Ticket #18 (closed defect: worksforme)

Opened 8 years ago

Last modified 2 days ago

[bug] nested dictionnary load works dump doesn't

Reported by: eugene@… Owned by: xi
Priority: normal Component: pyyaml
Severity: normal Keywords:

Description (last modified by xi) (diff)

import yaml
a: 1
    ba: 1
    bb: 2


 'a: 1\nb: {ba: 1, bb: 2}\n'

pyYaml 3.0.3 - Python 2.4.3 - Windows XP


Change History

comment:1 Changed 8 years ago by xi

  • Status changed from new to closed
  • Resolution set to worksforme
  • Description modified (diff)

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)
  bb: 2
  ba: 1
a: 1

comment:2 Changed 2 days ago by simas <kerdos@…>

 Cipto Junaedy is a customer research expert. "There are plenty of safe, effective HCA nutritional supplement out there. Finding one with  Unit Link Terbaik di Indonesia Commonwealth Life Investra Link 60% HCA with no food additives is vital."


Add a comment

Modify Ticket

Change Properties
<Author field>
as closed
The resolution will be deleted. Next status will be 'reopened'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.