Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9c2fc47

Browse files
committed
Fix minor grammar nits.
Revert r88272 -- the examples are more readable with spacing. Add todos for difflib and logging.
1 parent e2ae807 commit 9c2fc47

1 file changed

Lines changed: 20 additions & 27 deletions

File tree

Doc/whatsnew/3.2.rst

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ overcome the limitations of :mod:`optparse` which did not provide support for
8888
positional arguments (not just options), subcommands, required options and other
8989
common patterns of specifying and validating options.
9090

91-
This module already has widespread success in the community as a
91+
This module has already had widespread success in the community as a
9292
third-party module. Being more fully featured than its predecessor, the
9393
:mod:`argparse` module is now the preferred module for command-line processing.
9494
The older module is still being kept available because of the substantial amount
@@ -100,18 +100,18 @@ or more positional arguments is present, and making a required option::
100100

101101
import argparse
102102
parser = argparse.ArgumentParser(
103-
description='Manage servers', # main description for help
104-
epilog='Tested on Solaris and Linux') # displayed after help
103+
description = 'Manage servers', # main description for help
104+
epilog = 'Tested on Solaris and Linux') # displayed after help
105105
parser.add_argument('action', # argument name
106-
choices=['deploy', 'start', 'stop'], # three allowed values
107-
help='action on each target') # help msg
106+
choices = ['deploy', 'start', 'stop'], # three allowed values
107+
help = 'action on each target') # help msg
108108
parser.add_argument('targets',
109-
metavar='HOSTNAME', # var name used in help msg
110-
nargs='+', # require one or more targets
111-
help='url for target machines') # help msg explanation
109+
metavar = 'HOSTNAME', # var name used in help msg
110+
nargs = '+', # require one or more targets
111+
help = 'url for target machines') # help msg explanation
112112
parser.add_argument('-u', '--user', # -u or --user option
113-
required=True, # make it a required argument
114-
help='login as user')
113+
required = True, # make it a required argument
114+
help = 'login as user')
115115

116116
Example of calling the parser on a command string::
117117

@@ -329,7 +329,7 @@ aspects that are visible to the programmer:
329329
* The :mod:`py_compile` and :mod:`compileall` modules have been updated to
330330
reflect the new naming convention and target directory. The command-line
331331
invocation of *compileall* has new command-line options: ``-i`` for
332-
specifying a list of files and directories to compile, and ``-b`` which causes
332+
specifying a list of files and directories to compile and ``-b`` which causes
333333
bytecode files to be written to their legacy location rather than
334334
*__pycache__*.
335335

@@ -391,7 +391,7 @@ the bodies of requests and responses.
391391
The *native strings* are always of type :class:`str` but are restricted to code
392392
points between *U+0000* through *U+00FF* which are translatable to bytes using
393393
*Latin-1* encoding. These strings are used for the keys and values in the
394-
``environ`` dictionary and for response headers and statuses in the
394+
environment dictionary and for response headers and statuses in the
395395
:func:`start_response` function. They must follow :rfc:`2616` with respect to
396396
encoding. That is, they must either be *ISO-8859-1* characters or use
397397
:rfc:`2047` MIME encoding.
@@ -1414,7 +1414,7 @@ ast
14141414
---
14151415

14161416
The :mod:`ast` module has a wonderful a general-purpose tool for safely
1417-
evaluating strings containing Python expressions using the Python literal
1417+
evaluating expression strings using the Python literal
14181418
syntax. The :func:`ast.literal_eval` function serves as a secure alternative to
14191419
the builtin :func:`eval` function which is easily abused. Python 3.2 adds
14201420
:class:`bytes` and :class:`set` literals to the list of supported types:
@@ -1881,8 +1881,7 @@ object. The former returns a string and the latter prints it::
18811881
dbm
18821882
---
18831883

1884-
All database modules now support :meth:`get` and :meth:`setdefault` are now
1885-
available in all database modules
1884+
All database modules now support the :meth:`get` and :meth:`setdefault` methods.
18861885

18871886
(Suggested by Ray Allen in :issue:`9523`.)
18881887

@@ -2094,14 +2093,8 @@ reading directly from dictionaries and strings.
20942093

20952094
(All changes contributed by Łukasz Langa.)
20962095

2097-
difflib
2098-
-------
2099-
2100-
:class:`difflib.SequenceMatcher` has a new parameter in its constructor,
2101-
*autojunk*, that allows the user to turn off the automatic junk heuristic the
2102-
class uses in its algorithm. Additionally, two new attributes were exposed
2103-
to users - *bjunk* and *bpopular*, allowing better understanding of the
2104-
heuristics used by the class.
2096+
.. XXX show a difflib example
2097+
.. XXX add entry for logging changes other than the dict config pep
21052098
21062099
urllib.parse
21072100
------------
@@ -2460,13 +2453,13 @@ Changes to Python's build process and to the C API include:
24602453
function declaration, which was kept for backwards compatibility reasons, is
24612454
now removed -- the macro was introduced in 1997 (:issue:`8276`).
24622455

2463-
* The is a new function :c:func:`PyLong_AsLongLongAndOverflow` which
2456+
* There is a new function :c:func:`PyLong_AsLongLongAndOverflow` which
24642457
is analogous to :c:func:`PyLong_AsLongAndOverflow`. They both serve to
24652458
convert Python :class:`int` into a native fixed-width type while providing
24662459
detection of cases where the conversion won't fit (:issue:`7767`).
24672460

2468-
* The :c:func:`PyUnicode_CompareWithASCIIString` now returns *not equal*
2469-
if the Python string is *NUL* terminated.
2461+
* The :c:func:`PyUnicode_CompareWithASCIIString` function now returns *not
2462+
equal* if the Python string is *NUL* terminated.
24702463

24712464
* There is a new function :c:func:`PyErr_NewExceptionWithDoc` that is
24722465
like :c:func:`PyErr_NewException` but allows a docstring to be specified.
@@ -2621,6 +2614,6 @@ require changes to your code:
26212614
and :c:func:`PyEval_RestoreThread()`) should be used instead.
26222615

26232616
* Due to security risks, :func:`asyncore.handle_accept` has been deprecated, and
2624-
a new function, :func:`asyncore.handle_accepted` was added to replace it.
2617+
a new function, :func:`asyncore.handle_accepted`, was added to replace it.
26252618

26262619
(Contributed by Giampaolo Rodola in :issue:`6706`.)

0 commit comments

Comments
 (0)