]> granicus.if.org Git - python/commitdiff
Fix grammar, typos and markup in documentation and code comments
authorMartin Panter <vadmium+py@gmail.com>
Sat, 14 Jan 2017 08:23:08 +0000 (08:23 +0000)
committerMartin Panter <vadmium+py@gmail.com>
Sat, 14 Jan 2017 08:23:08 +0000 (08:23 +0000)
* Indent versionchanged at method level, not class level
* Mark up ``--help`` to avoid generating an en dash
* Use forward slash in Unix command line with a dollar sign ($) prompt

Doc/library/argparse.rst
Doc/library/unittest.rst
Misc/NEWS
Modules/_collectionsmodule.c
Modules/_io/textio.c
Objects/odictobject.c

index c6b2bf6f1d7d1afd300cad8280ceea0006abf868..45303048174dfabf5437b26da90f415d5af1cc33 100644 (file)
@@ -174,7 +174,7 @@ ArgumentParser objects
    * conflict_handler_ - The strategy for resolving conflicting optionals
      (usually unnecessary)
 
-   * add_help_ - Add a -h/--help option to the parser (default: ``True``)
+   * add_help_ - Add a ``-h/--help`` option to the parser (default: ``True``)
 
    * allow_abbrev_ - Allows long options to be abbreviated if the
      abbreviation is unambiguous. (default: ``True``)
@@ -211,7 +211,7 @@ The help for this program will display ``myprogram.py`` as the program name
     -h, --help  show this help message and exit
     --foo FOO   foo help
    $ cd ..
-   $ python subdir\myprogram.py --help
+   $ python subdir/myprogram.py --help
    usage: myprogram.py [-h] [--foo FOO]
 
    optional arguments:
index ac1224cdbff11af1c8a3ed0e1898ca844edac572..f02b16a24ef1887402a067303231c5d8a71bea95 100644 (file)
@@ -1637,11 +1637,11 @@ Loading and running tests
 
       The method optionally resolves *name* relative to the given *module*.
 
-   .. versionchanged:: 3.5
-      If an :exc:`ImportError` or :exc:`AttributeError` occurs while traversing
-      *name* then a synthetic test that raises that error when run will be
-      returned. These errors are included in the errors accumulated by
-      self.errors.
+      .. versionchanged:: 3.5
+         If an :exc:`ImportError` or :exc:`AttributeError` occurs while traversing
+         *name* then a synthetic test that raises that error when run will be
+         returned. These errors are included in the errors accumulated by
+         self.errors.
 
 
    .. method:: loadTestsFromNames(names, module=None)
index 159b2255da6d7b5ef230f898b3a45e8194453311..9a5e729faecbb5ed21e2bfd4957da7d4b135ee83 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -189,7 +189,7 @@ Library
   WeakValueDictionary.pop() when a GC collection happens in another
   thread.
 
-- Issue #20191: Fixed a crash in resource.prlimit() when pass a sequence that
+- Issue #20191: Fixed a crash in resource.prlimit() when passing a sequence that
   doesn't own its elements as limits.
 
 - Issue #28779: multiprocessing.set_forkserver_preload() would crash the
index 10fbcfe6b9bb99711ee49ef1ac4db3b014b2b6ab..ac81680e1bd7101945bbea82e3756a5832660b58 100644 (file)
@@ -2169,7 +2169,7 @@ static PyTypeObject defdict_type = {
 PyDoc_STRVAR(_count_elements_doc,
 "_count_elements(mapping, iterable) -> None\n\
 \n\
-Count elements in the iterable, updating the mappping");
+Count elements in the iterable, updating the mapping");
 
 static PyObject *
 _count_elements(PyObject *self, PyObject *args)
index 46c99b5a1d4b19694a981b92a212d01a8da37131..89b0798cd0b6876fea2267c0d75511f1481a939a 100644 (file)
@@ -1012,7 +1012,7 @@ _io_TextIOWrapper___init___impl(textio *self, PyObject *buffer,
                                                            errors);
         if (self->encoder == NULL)
             goto error;
-        /* Get the normalized named of the codec */
+        /* Get the normalized name of the codec */
         res = _PyObject_GetAttrId(codec_info, &PyId_name);
         if (res == NULL) {
             if (PyErr_ExceptionMatches(PyExc_AttributeError))
index a6963d7d53d4b51c87f7a9688b09453b7d4fee30..73deedf360718814a8b3355290b7c410950db86c 100644 (file)
@@ -2237,7 +2237,7 @@ odictvalues_new(PyObject *od)
 
 
 /* ----------------------------------------------
-   MutableMappping implementations
+   MutableMapping implementations
 
 Mapping: