Changes between Version 8 and Version 9 of PyYAMLDocumentation
- Timestamp:
- 05/05/06 18:56:25 (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
PyYAMLDocumentation
v8 v9 202 202 '''`yaml.dump`''' supports a number of keyword arguments that specify 203 203 formatting details for the emitter. For instance, you may set the 204 preferred intendation and width or use the canonical YAML format. 204 preferred intendation and width, use the canonical YAML format or 205 force preferred style for scalars and collections. 205 206 {{{ 206 207 #!python 207 208 >>> print yaml.dump(range(50)) 208 209 209 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 210 210 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, … … 212 212 213 213 >>> print yaml.dump(range(50), width=50, indent=4) 214 215 214 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 216 215 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, … … 219 218 220 219 >>> print yaml.dump(range(5), canonical=True) 221 222 220 --- 223 221 !!seq [ … … 228 226 !!int "4", 229 227 ] 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"] 230 238 }}} 231 239 … … 597 605 2. a `!!str` scalar otherwise. 598 606 607 599 608 === Names and modules === 600 609 … … 610 619 !!python/module:yaml 611 620 }}} 621 612 622 613 623 === Objects === … … 644 654 !!python/object/apply:module.function [argument, ...] 645 655 }}} 656 646 657 647 658 == Reference ==
