Changes between Version 8 and Version 9 of PyYAMLDocumentation


Ignore:
Timestamp:
05/05/06 18:56:25 (8 years ago)
Author:
xi
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PyYAMLDocumentation

    v8 v9  
    202202'''`yaml.dump`''' supports a number of keyword arguments that specify 
    203203formatting details for the emitter. For instance, you may set the 
    204 preferred intendation and width or use the canonical YAML format. 
     204preferred intendation and width, use the canonical YAML format or 
     205force preferred style for scalars and collections. 
    205206{{{ 
    206207#!python 
    207208>>> print yaml.dump(range(50)) 
    208  
    209209[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 
    210210  23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 
     
    212212 
    213213>>> print yaml.dump(range(50), width=50, indent=4) 
    214  
    215214[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 
    216215    16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 
     
    219218 
    220219>>> print yaml.dump(range(5), canonical=True) 
    221  
    222220--- 
    223221!!seq [ 
     
    228226  !!int "4", 
    229227] 
     228 
     229>>> print yaml.dump(range(5), default_flow_style=False) 
     230- 0 
     231- 1 
     232- 2 
     233- 3 
     234- 4 
     235 
     236>>> print yaml.dump(range(5), default_flow_style=True, default_style='"') 
     237[!!int "0", !!int "1", !!int "2", !!int "3", !!int "4"] 
    230238}}} 
    231239 
     
    597605 2. a `!!str` scalar otherwise. 
    598606 
     607 
    599608=== Names and modules === 
    600609 
     
    610619!!python/module:yaml 
    611620}}} 
     621 
    612622 
    613623=== Objects === 
     
    644654!!python/object/apply:module.function [argument, ...] 
    645655}}} 
     656 
    646657 
    647658== Reference ==