Changes between Version 48 and Version 49 of PyYAMLDocumentation


Ignore:
Timestamp:
07/08/12 18:18:58 (2 years ago)
Author:
anonymous
Comment:

Fix some minor grammar problems and word choices.

Legend:

Unmodified
Added
Removed
Modified
  • PyYAMLDocumentation

    v48 v49  
    240240 
    241241Note that the ability to construct an arbitrary Python object may be dangerous 
    242 if you receive a YAML document from an untrusted source such as Internet. 
     242if you receive a YAML document from an untrusted source such as the Internet. 
    243243The function '''`yaml.safe_load`''' limits this ability to simple Python objects 
    244244like integers or lists. 
     
    409409 
    410410 
    411 The default representation for '''`Dice`''' objects is not nice: 
     411The default representation for '''`Dice`''' objects is not pretty: 
    412412{{{ 
    413413#!python 
     
    426426}}} 
    427427 
    428 First we define a representer that convert a dice object to scalar node 
    429 with the tag `!dice` and register it. 
     428First we define a representer that converts a dice object to a scalar node 
     429with the tag `!dice`, then we register it. 
    430430{{{ 
    431431#!python 
     
    464464}}} 
    465465 
    466 You might want to not specify the tag `!dice` everywhere. There is a way 
    467 to teach PyYAML that any untagged plain scalar that looks like XdY has 
     466You might not want to specify the tag `!dice` everywhere. There is a way 
     467to teach PyYAML that any untagged plain scalar which looks like XdY has 
    468468the implicit tag `!dice`. Use '''`add_implicit_resolver`''': 
    469469{{{ 
     
    535535--- 
    536536- C 
    537 - C#    # Note that comments are denoted with ' #' (space and #). 
     537- C#    # Note that comments are denoted with ' #' (space then #). 
    538538- C++ 
    539539- Cold Fusion 
     
    543543=== Block sequences === 
    544544 
    545 In the block context, sequence entries are denoted by '''`- `''' (dash and space): 
     545In the block context, sequence entries are denoted by '''`- `''' (dash then space): 
    546546{{{ 
    547547# YAML 
     
    616616=== Block mappings === 
    617617 
    618 In the block context, keys and values of mappings are separated by '''`: `''' (colon and space): 
     618In the block context, keys and values of mappings are separated by '''`: `''' (colon then space): 
    619619{{{ 
    620620# YAML 
     
    631631}}} 
    632632 
    633 Complex keys are denoted with '''`? `''' (question mark and space): 
     633Complex keys are denoted with '''`? `''' (question mark then space): 
    634634{{{ 
    635635# YAML 
     
    744744 
    745745Using single-quoted scalars, you may express any value that does not contain special characters. 
    746 No escaping occurs for single quoted scalars except that duplicate quotes '''`''`''' are replaced 
    747 with a single quote '''`'`'''. 
     746No escaping occurs for single quoted scalars except that a pair of adjacent quotes '''`''`''' is replaced 
     747with a lone single quote '''`'`'''. 
    748748 
    749749Double-quoted is the most powerful style and the only style that can express any scalar value. 
     
    753753There are two kind of block scalar styles: '''literal''' and '''folded'''. The literal style is 
    754754the most suitable style for large block of text such as source code. The folded style is similar 
    755 to the literal style, but two consequent non-empty lines are joined to a single line separated 
     755to the literal style, but two adjacent non-empty lines are joined to a single line separated 
    756756by a space character. 
    757757 
     
    808808}}} 
    809809 
    810 Plain scalars without explicitly defined tag are subject to implicit tag 
     810Plain scalars without explicitly defined tags are subject to implicit tag 
    811811resolution. The scalar value is checked against a set of regular expressions 
    812812 
     
    960960 
    961961'''`emit(events, stream=None)`''' serializes the given sequence of parsing `events` and 
    962 write them to the `stream`. if `stream` is `None`, it returns the produced stream. 
     962writes them to the `stream`. if `stream` is `None`, it returns the produced stream. 
    963963 
    964964{{{ 
     
    10691069}}} 
    10701070 
    1071 '''`add_constructor(tag, constructor)`''' allows to specify a `constructor` for the given `tag`. 
     1071'''`add_constructor(tag, constructor)`''' specifies a `constructor` for the given `tag`. 
    10721072A constructor is a function that converts a node of a YAML representation graph to a native Python object. 
    10731073A constructor accepts an instance of `Loader` and a node and returns a Python object. 
    10741074 
    1075 '''`add_multi_constructor(tag_prefix, multi_constructor)`''' allows to specify a `multi_constructor` 
     1075'''`add_multi_constructor(tag_prefix, multi_constructor)`''' specifies a `multi_constructor` 
    10761076for the given `tag_prefix`. A multi-constructor is a function that converts a node of a YAML 
    10771077representation graph to a native Python object. A multi-constructor accepts an instance of `Loader`, 
     
    10921092}}} 
    10931093 
    1094 '''`add_representer(data_type, representer)`''' allows to specify a `representer` for Python objects 
     1094'''`add_representer(data_type, representer)`''' specifies a `representer` for Python objects 
    10951095of the given `data_type`. A representer is a function that converts a native Python object to a node 
    10961096of a YAML representation graph. A representer accepts an instance of `Dumper` and an object and returns a node. 
    10971097 
    1098 '''`add_multi_representer(base_data_type, multi_representer)`''' allows to specify a `multi_representer` 
     1098'''`add_multi_representer(base_data_type, multi_representer)`''' specifies a `multi_representer` 
    10991099for Python objects of the given `base_data_type` or any of its subclasses. A multi-representer is 
    11001100a function that converts a native Python object to a node of a YAML representation graph. 
     
    15871587}}} 
    15881588 
    1589 '''`Dumper.emit(event)`''' serializes the given `event` and write it to the output stream. 
     1589'''`Dumper.emit(event)`''' serializes the given `event` and writes it to the output stream. 
    15901590 
    15911591{{{