Issue #26778: Fixed "a/an/and" typos in code comment and documentation.

This commit is contained in:
Serhiy Storchaka 2016-04-17 09:37:36 +03:00
parent 0bb165ecc1
commit 9a118f1dc3
72 changed files with 90 additions and 90 deletions

View File

@ -11,7 +11,7 @@
# program. # program.
# This file demonstrates the use of the tixBalloon widget, which provides # This file demonstrates the use of the tixBalloon widget, which provides
# a interesting way to give help tips about elements in your user interface. # an interesting way to give help tips about elements in your user interface.
# Your can display the help message in a "balloon" and a status bar widget. # Your can display the help message in a "balloon" and a status bar widget.
# #

View File

@ -155,7 +155,7 @@ def RunSample(w):
net = Tix.Button(w, padx=4, pady=1, width=120) net = Tix.Button(w, padx=4, pady=1, width=120)
# Create the first image: we create a line, then put a string, # Create the first image: we create a line, then put a string,
# a space and a image into this line, from left to right. # a space and an image into this line, from left to right.
# The result: we have a one-line image that consists of three # The result: we have a one-line image that consists of three
# individual items # individual items
# #

View File

@ -157,7 +157,7 @@ Object Protocol
.. index:: builtin: bytes .. index:: builtin: bytes
Compute a bytes representation of object *o*. In 2.x, this is just a alias Compute a bytes representation of object *o*. In 2.x, this is just an alias
for :c:func:`PyObject_Str`. for :c:func:`PyObject_Str`.

View File

@ -140,7 +140,7 @@ or :class:`frozenset` or instances of their subtypes.
Add *key* to a :class:`set` instance. Does not apply to :class:`frozenset` Add *key* to a :class:`set` instance. Does not apply to :class:`frozenset`
instances. Return 0 on success or -1 on failure. Raise a :exc:`TypeError` if instances. Return 0 on success or -1 on failure. Raise a :exc:`TypeError` if
the *key* is unhashable. Raise a :exc:`MemoryError` if there is no room to grow. the *key* is unhashable. Raise a :exc:`MemoryError` if there is no room to grow.
Raise a :exc:`SystemError` if *set* is an not an instance of :class:`set` or its Raise a :exc:`SystemError` if *set* is not an instance of :class:`set` or its
subtype. subtype.
.. versionchanged:: 2.6 .. versionchanged:: 2.6
@ -158,7 +158,7 @@ subtypes but not for instances of :class:`frozenset` or its subtypes.
error is encountered. Does not raise :exc:`KeyError` for missing keys. Raise a error is encountered. Does not raise :exc:`KeyError` for missing keys. Raise a
:exc:`TypeError` if the *key* is unhashable. Unlike the Python :meth:`~set.discard` :exc:`TypeError` if the *key* is unhashable. Unlike the Python :meth:`~set.discard`
method, this function does not automatically convert unhashable sets into method, this function does not automatically convert unhashable sets into
temporary frozensets. Raise :exc:`PyExc_SystemError` if *set* is an not an temporary frozensets. Raise :exc:`PyExc_SystemError` if *set* is not an
instance of :class:`set` or its subtype. instance of :class:`set` or its subtype.
@ -166,7 +166,7 @@ subtypes but not for instances of :class:`frozenset` or its subtypes.
Return a new reference to an arbitrary object in the *set*, and removes the Return a new reference to an arbitrary object in the *set*, and removes the
object from the *set*. Return *NULL* on failure. Raise :exc:`KeyError` if the object from the *set*. Return *NULL* on failure. Raise :exc:`KeyError` if the
set is empty. Raise a :exc:`SystemError` if *set* is an not an instance of set is empty. Raise a :exc:`SystemError` if *set* is not an instance of
:class:`set` or its subtype. :class:`set` or its subtype.

View File

@ -260,7 +260,7 @@ APIs:
| :attr:`%%` | *n/a* | The literal % character. | | :attr:`%%` | *n/a* | The literal % character. |
+-------------------+---------------------+--------------------------------+ +-------------------+---------------------+--------------------------------+
| :attr:`%c` | int | A single character, | | :attr:`%c` | int | A single character, |
| | | represented as an C int. | | | | represented as a C int. |
+-------------------+---------------------+--------------------------------+ +-------------------+---------------------+--------------------------------+
| :attr:`%d` | int | Exactly equivalent to | | :attr:`%d` | int | Exactly equivalent to |
| | | ``printf("%d")``. | | | | ``printf("%d")``. |

View File

@ -832,7 +832,7 @@ selection by :class:`MSVCCompiler`.
.. module:: distutils.bcppcompiler .. module:: distutils.bcppcompiler
This module provides :class:`BorlandCCompiler`, an subclass of the abstract This module provides :class:`BorlandCCompiler`, a subclass of the abstract
:class:`CCompiler` class for the Borland C++ compiler. :class:`CCompiler` class for the Borland C++ compiler.

View File

@ -6,7 +6,7 @@
.. note:: .. note::
There is an French translation of an earlier revision of this There is a French translation of an earlier revision of this
HOWTO, available at `urllib2 - Le Manuel manquant HOWTO, available at `urllib2 - Le Manuel manquant
<http://www.voidspace.org.uk/python/articles/urllib2_francais.shtml>`_. <http://www.voidspace.org.uk/python/articles/urllib2_francais.shtml>`_.

View File

@ -657,7 +657,7 @@ positive integer::
TenPointsArrayType = POINT * 10 TenPointsArrayType = POINT * 10
Here is an example of an somewhat artificial data type, a structure containing 4 Here is an example of a somewhat artificial data type, a structure containing 4
POINTs among other stuff:: POINTs among other stuff::
>>> from ctypes import * >>> from ctypes import *
@ -1576,7 +1576,7 @@ They are instances of a private class:
tuple, this method allows adapting the actual argument to an object that tuple, this method allows adapting the actual argument to an object that
the foreign function accepts. For example, a :class:`c_char_p` item in the foreign function accepts. For example, a :class:`c_char_p` item in
the :attr:`argtypes` tuple will convert a unicode string passed as the :attr:`argtypes` tuple will convert a unicode string passed as
argument into an byte string using ctypes conversion rules. argument into a byte string using ctypes conversion rules.
New: It is now possible to put items in argtypes which are not ctypes New: It is now possible to put items in argtypes which are not ctypes
types, but each item must have a :meth:`from_param` method which returns a types, but each item must have a :meth:`from_param` method which returns a
@ -1964,7 +1964,7 @@ Utility functions
.. function:: POINTER(type) .. function:: POINTER(type)
This factory function creates and returns a new ctypes pointer type. Pointer This factory function creates and returns a new ctypes pointer type. Pointer
types are cached an reused internally, so calling this function repeatedly is types are cached and reused internally, so calling this function repeatedly is
cheap. *type* must be a ctypes type. cheap. *type* must be a ctypes type.

View File

@ -310,7 +310,7 @@ here.
.. method:: form.add_input(type, x, y, w, h, name) .. method:: form.add_input(type, x, y, w, h, name)
Add a input object to the form. --- Methods: :meth:`set_input`, Add an input object to the form. --- Methods: :meth:`set_input`,
:meth:`get_input`, :meth:`set_input_color`, :meth:`set_input_return`. :meth:`get_input`, :meth:`set_input_color`, :meth:`set_input_return`.

View File

@ -128,7 +128,7 @@ Find Selection
Search for the currently selected string, if there is one. Search for the currently selected string, if there is one.
Find in Files... Find in Files...
Open a file search dialog. Put results in an new output window. Open a file search dialog. Put results in a new output window.
Replace... Replace...
Open a search-and-replace dialog. Open a search-and-replace dialog.

View File

@ -66,7 +66,7 @@ The module defines these functions:
.. function:: dump(value, file[, version]) .. function:: dump(value, file[, version])
Write the value on the open file. The value must be a supported type. The Write the value on the open file. The value must be a supported type. The
file must be a open file object such as ``sys.stdout`` or returned by file must be an open file object such as ``sys.stdout`` or returned by
:func:`open` or :func:`os.popen`. It may not be a wrapper such as :func:`open` or :func:`os.popen`. It may not be a wrapper such as
TemporaryFile on Windows. It must be opened in binary mode (``'wb'`` TemporaryFile on Windows. It must be opened in binary mode (``'wb'``
or ``'w+b'``). or ``'w+b'``).

View File

@ -788,7 +788,7 @@ The ``errors`` object has the following attributes:
.. data:: XML_ERROR_UNDEFINED_ENTITY .. data:: XML_ERROR_UNDEFINED_ENTITY
:noindex: :noindex:
A reference was made to a entity which was not defined. A reference was made to an entity which was not defined.
.. data:: XML_ERROR_UNKNOWN_ENCODING .. data:: XML_ERROR_UNKNOWN_ENCODING

View File

@ -34,7 +34,7 @@ the built-in :func:`open` function so that it raises an exception whenever the
*mode* parameter is ``'w'``. It might also perform a :c:func:`chroot`\ -like *mode* parameter is ``'w'``. It might also perform a :c:func:`chroot`\ -like
operation on the *filename* parameter, such that root is always relative to some operation on the *filename* parameter, such that root is always relative to some
safe "sandbox" area of the filesystem. In this case, the untrusted code would safe "sandbox" area of the filesystem. In this case, the untrusted code would
still see an built-in :func:`open` function in its environment, with the same still see a built-in :func:`open` function in its environment, with the same
calling interface. The semantics would be identical too, with :exc:`IOError`\ s calling interface. The semantics would be identical too, with :exc:`IOError`\ s
being raised when the supervisor determined that an unallowable parameter is being raised when the supervisor determined that an unallowable parameter is
being used. being used.

View File

@ -162,7 +162,7 @@ A single exception is defined as well:
.. method:: SGMLParser.handle_entityref(ref) .. method:: SGMLParser.handle_entityref(ref)
This method is called to process a general entity reference of the form This method is called to process a general entity reference of the form
``&ref;`` where *ref* is an general entity reference. It converts *ref* by ``&ref;`` where *ref* is a general entity reference. It converts *ref* by
passing it to :meth:`convert_entityref`. If a translation is returned, it calls passing it to :meth:`convert_entityref`. If a translation is returned, it calls
the method :meth:`handle_data` with the translation; otherwise, it calls the the method :meth:`handle_data` with the translation; otherwise, it calls the
method ``unknown_entityref(ref)``. The default :attr:`entitydefs` defines method ``unknown_entityref(ref)``. The default :attr:`entitydefs` defines

View File

@ -123,7 +123,7 @@ methods (except ``control`` objects which only provide :meth:`getinfo`,
.. method:: audio device.setinfo(status) .. method:: audio device.setinfo(status)
This method sets the audio device status parameters. The *status* parameter is This method sets the audio device status parameters. The *status* parameter is
an device status object as returned by :func:`getinfo` and possibly modified by a device status object as returned by :func:`getinfo` and possibly modified by
the program. the program.

View File

@ -110,10 +110,10 @@ Some facts and figures:
+-------------+--------------------------------------------+ +-------------+--------------------------------------------+
| ``'w|'`` | Open an uncompressed *stream* for writing. | | ``'w|'`` | Open an uncompressed *stream* for writing. |
+-------------+--------------------------------------------+ +-------------+--------------------------------------------+
| ``'w|gz'`` | Open an gzip compressed *stream* for | | ``'w|gz'`` | Open a gzip compressed *stream* for |
| | writing. | | | writing. |
+-------------+--------------------------------------------+ +-------------+--------------------------------------------+
| ``'w|bz2'`` | Open an bzip2 compressed *stream* for | | ``'w|bz2'`` | Open a bzip2 compressed *stream* for |
| | writing. | | | writing. |
+-------------+--------------------------------------------+ +-------------+--------------------------------------------+

View File

@ -276,7 +276,7 @@ File Selectors
The `ExFileSelectBox The `ExFileSelectBox
<http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixExFileSelectBox.htm>`_ <http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixExFileSelectBox.htm>`_
widget is usually embedded in a tixExFileSelectDialog widget. It provides an widget is usually embedded in a tixExFileSelectDialog widget. It provides a
convenient method for the user to select files. The style of the convenient method for the user to select files. The style of the
:class:`ExFileSelectBox` widget is very similar to the standard file dialog on :class:`ExFileSelectBox` widget is very similar to the standard file dialog on
MS Windows 3.1. MS Windows 3.1.

View File

@ -280,7 +280,7 @@ Utility functions
.. function:: url2pathname(path) .. function:: url2pathname(path)
Convert the path component *path* from an percent-encoded URL to the local syntax for a Convert the path component *path* from a percent-encoded URL to the local syntax for a
path. This does not accept a complete URL. This function uses :func:`unquote` path. This does not accept a complete URL. This function uses :func:`unquote`
to decode *path*. to decode *path*.

View File

@ -452,7 +452,7 @@ objects, such as lists.
Though tuples may seem similar to lists, they are often used in different Though tuples may seem similar to lists, they are often used in different
situations and for different purposes. situations and for different purposes.
Tuples are :term:`immutable`, and usually contain an heterogeneous sequence of Tuples are :term:`immutable`, and usually contain a heterogeneous sequence of
elements that are accessed via unpacking (see later in this section) or indexing elements that are accessed via unpacking (see later in this section) or indexing
(or even by attribute in the case of :func:`namedtuples <collections.namedtuple>`). (or even by attribute in the case of :func:`namedtuples <collections.namedtuple>`).
Lists are :term:`mutable`, and their elements are usually homogeneous and are Lists are :term:`mutable`, and their elements are usually homogeneous and are

View File

@ -307,7 +307,7 @@ For non-negative indices, the length of a slice is the difference of the
indices, if both are within bounds. For example, the length of ``word[1:3]`` is indices, if both are within bounds. For example, the length of ``word[1:3]`` is
2. 2.
Attempting to use a index that is too large will result in an error:: Attempting to use an index that is too large will result in an error::
>>> word[42] # the word only has 6 characters >>> word[42] # the word only has 6 characters
Traceback (most recent call last): Traceback (most recent call last):

View File

@ -720,7 +720,7 @@ possible types of the operands.
(The controversy is over whether this is *really* a design flaw, and whether (The controversy is over whether this is *really* a design flaw, and whether
it's worth breaking existing code to fix this. It's caused endless discussions it's worth breaking existing code to fix this. It's caused endless discussions
on python-dev, and in July 2001 erupted into an storm of acidly sarcastic on python-dev, and in July 2001 erupted into a storm of acidly sarcastic
postings on :newsgroup:`comp.lang.python`. I won't argue for either side here postings on :newsgroup:`comp.lang.python`. I won't argue for either side here
and will stick to describing what's implemented in 2.2. Read :pep:`238` for a and will stick to describing what's implemented in 2.2. Read :pep:`238` for a
summary of arguments and counter-arguments.) summary of arguments and counter-arguments.)

View File

@ -411,7 +411,7 @@ PEP 279: enumerate()
A new built-in function, :func:`enumerate`, will make certain loops a bit A new built-in function, :func:`enumerate`, will make certain loops a bit
clearer. ``enumerate(thing)``, where *thing* is either an iterator or a clearer. ``enumerate(thing)``, where *thing* is either an iterator or a
sequence, returns a iterator that will return ``(0, thing[0])``, ``(1, sequence, returns an iterator that will return ``(0, thing[0])``, ``(1,
thing[1])``, ``(2, thing[2])``, and so forth. thing[1])``, ``(2, thing[2])``, and so forth.
A common idiom to change every element of a list looks like this:: A common idiom to change every element of a list looks like this::

View File

@ -2,7 +2,7 @@
/* List object interface */ /* List object interface */
/* /*
Another generally useful object type is an list of object pointers. Another generally useful object type is a list of object pointers.
This is a mutable type: the list items can be changed, and items can be This is a mutable type: the list items can be changed, and items can be
added or removed. Out-of-range indices or non-list objects are ignored. added or removed. Out-of-range indices or non-list objects are ignored.

View File

@ -707,7 +707,7 @@ class StreamRequestHandler(BaseRequestHandler):
try: try:
self.wfile.flush() self.wfile.flush()
except socket.error: except socket.error:
# An final socket error may have occurred here, such as # A final socket error may have occurred here, such as
# the local error ECONNABORTED. # the local error ECONNABORTED.
pass pass
self.wfile.close() self.wfile.close()

View File

@ -420,7 +420,7 @@ class IOBase:
return self.__closed return self.__closed
def _checkClosed(self, msg=None): def _checkClosed(self, msg=None):
"""Internal: raise an ValueError if file is closed """Internal: raise a ValueError if file is closed
""" """
if self.closed: if self.closed:
raise ValueError("I/O operation on closed file." raise ValueError("I/O operation on closed file."
@ -2022,7 +2022,7 @@ class StringIO(TextIOWrapper):
def __repr__(self): def __repr__(self):
# TextIOWrapper tells the encoding in its repr. In StringIO, # TextIOWrapper tells the encoding in its repr. In StringIO,
# that's a implementation detail. # that's an implementation detail.
return object.__repr__(self) return object.__repr__(self)
@property @property

View File

@ -142,7 +142,7 @@ class Calendar(object):
def iterweekdays(self): def iterweekdays(self):
""" """
Return a iterator for one week of weekday numbers starting with the Return an iterator for one week of weekday numbers starting with the
configured first one. configured first one.
""" """
for i in range(self.firstweekday, self.firstweekday + 7): for i in range(self.firstweekday, self.firstweekday + 7):

View File

@ -224,7 +224,7 @@ class InvalidOperation(DecimalException):
class ConversionSyntax(InvalidOperation): class ConversionSyntax(InvalidOperation):
"""Trying to convert badly formed string. """Trying to convert badly formed string.
This occurs and signals invalid-operation if an string is being This occurs and signals invalid-operation if a string is being
converted to a number and it does not conform to the numeric string converted to a number and it does not conform to the numeric string
syntax. The result is [0,qNaN]. syntax. The result is [0,qNaN].
""" """

View File

@ -1487,7 +1487,7 @@ def _mdiff(fromlines, tolines, context=None, linejunk=None,
yield _make_line(lines,'-',0), None, True yield _make_line(lines,'-',0), None, True
continue continue
elif s.startswith(('--?+', '--+', '- ')): elif s.startswith(('--?+', '--+', '- ')):
# in delete block and see a intraline change or unchanged line # in delete block and see an intraline change or unchanged line
# coming: yield the delete line and then blanks # coming: yield the delete line and then blanks
from_line,to_line = _make_line(lines,'-',0), None from_line,to_line = _make_line(lines,'-',0), None
num_blanks_to_yield,num_blanks_pending = num_blanks_pending-1,0 num_blanks_to_yield,num_blanks_pending = num_blanks_pending-1,0

View File

@ -10,9 +10,9 @@ cygwin in no-cygwin mode).
# #
# * if you use a msvc compiled python version (1.5.2) # * if you use a msvc compiled python version (1.5.2)
# 1. you have to insert a __GNUC__ section in its config.h # 1. you have to insert a __GNUC__ section in its config.h
# 2. you have to generate a import library for its dll # 2. you have to generate an import library for its dll
# - create a def-file for python??.dll # - create a def-file for python??.dll
# - create a import library using # - create an import library using
# dlltool --dllname python15.dll --def python15.def \ # dlltool --dllname python15.dll --def python15.def \
# --output-lib libpython15.a # --output-lib libpython15.a
# #

View File

@ -28,7 +28,7 @@ option involved with the exception.
# - RETURN_IN_ORDER option # - RETURN_IN_ORDER option
# - GNU extension with '-' as first character of option string # - GNU extension with '-' as first character of option string
# - optional arguments, specified by double colons # - optional arguments, specified by double colons
# - a option string with a W followed by semicolon should # - an option string with a W followed by semicolon should
# treat "-W foo" as "--foo" # treat "-W foo" as "--foo"
__all__ = ["GetoptError","error","getopt","gnu_getopt"] __all__ = ["GetoptError","error","getopt","gnu_getopt"]

View File

@ -67,7 +67,7 @@ class AutoComplete:
def try_open_completions_event(self, event): def try_open_completions_event(self, event):
"""Happens when it would be nice to open a completion list, but not """Happens when it would be nice to open a completion list, but not
really necessary, for example after an dot, so function really necessary, for example after a dot, so function
calls won't be made. calls won't be made.
""" """
lastchar = self.text.get("insert-1c") lastchar = self.text.get("insert-1c")

View File

@ -373,7 +373,7 @@ class StackViewer(ScrolledList):
def __init__(self, master, flist, gui): def __init__(self, master, flist, gui):
if macosxSupport.isAquaTk(): if macosxSupport.isAquaTk():
# At least on with the stock AquaTk version on OSX 10.4 you'll # At least on with the stock AquaTk version on OSX 10.4 you'll
# get an shaking GUI that eventually kills IDLE if the width # get a shaking GUI that eventually kills IDLE if the width
# argument is specified. # argument is specified.
ScrolledList.__init__(self, master) ScrolledList.__init__(self, master)
else: else:

View File

@ -68,7 +68,7 @@ class WidgetRedirector:
'''Return OriginalCommand(operation) after registering function. '''Return OriginalCommand(operation) after registering function.
Registration adds an operation: function pair to ._operations. Registration adds an operation: function pair to ._operations.
It also adds an widget function attribute that masks the Tkinter It also adds a widget function attribute that masks the Tkinter
class instance method. Method masking operates independently class instance method. Method masking operates independently
from command dispatch. from command dispatch.

View File

@ -1213,7 +1213,7 @@ class ConfigDialog(Toplevel):
All values are treated as text, and it is up to the user to supply All values are treated as text, and it is up to the user to supply
reasonable values. The only exception to this are the 'enable*' options, reasonable values. The only exception to this are the 'enable*' options,
which are boolean, and can be toggled with an True/False button. which are boolean, and can be toggled with a True/False button.
""" """
parent = self.parent parent = self.parent
frame = self.tabPages.pages['Extensions'].frame frame = self.tabPages.pages['Extensions'].frame

View File

@ -221,7 +221,7 @@ class Tk(Tkinter.Tk, tixCommand):
self.tk.eval('package require Tix') self.tk.eval('package require Tix')
def destroy(self): def destroy(self):
# For safety, remove an delete_window binding before destroy # For safety, remove the delete_window binding before destroy
self.protocol("WM_DELETE_WINDOW", "") self.protocol("WM_DELETE_WINDOW", "")
Tkinter.Tk.destroy(self) Tkinter.Tk.destroy(self)
@ -702,7 +702,7 @@ class DirSelectBox(TixWidget):
class ExFileSelectBox(TixWidget): class ExFileSelectBox(TixWidget):
"""ExFileSelectBox - MS Windows style file select box. """ExFileSelectBox - MS Windows style file select box.
It provides an convenient method for the user to select files. It provides a convenient method for the user to select files.
Subwidget Class Subwidget Class
--------- ----- --------- -----
@ -760,7 +760,7 @@ class DirSelectDialog(TixWidget):
# Should inherit from a Dialog class # Should inherit from a Dialog class
class ExFileSelectDialog(TixWidget): class ExFileSelectDialog(TixWidget):
"""ExFileSelectDialog - MS Windows style file select dialog. """ExFileSelectDialog - MS Windows style file select dialog.
It provides an convenient method for the user to select files. It provides a convenient method for the user to select files.
Subwidgets Class Subwidgets Class
---------- ----- ---------- -----

View File

@ -3,7 +3,7 @@
This is very preliminary. I currently only support dnd *within* one This is very preliminary. I currently only support dnd *within* one
application, between different windows (or within the same window). application, between different windows (or within the same window).
I an trying to make this as generic as possible -- not dependent on I am trying to make this as generic as possible -- not dependent on
the use of a particular widget or icon type, etc. I also hope that the use of a particular widget or icon type, etc. I also hope that
this will work with Pmw. this will work with Pmw.

View File

@ -2778,7 +2778,7 @@ class Menu(Widget):
self.deletecommand(c) self.deletecommand(c)
self.tk.call(self._w, 'delete', index1, index2) self.tk.call(self._w, 'delete', index1, index2)
def entrycget(self, index, option): def entrycget(self, index, option):
"""Return the resource value of an menu item for OPTION at INDEX.""" """Return the resource value of a menu item for OPTION at INDEX."""
return self.tk.call(self._w, 'entrycget', index, '-' + option) return self.tk.call(self._w, 'entrycget', index, '-' + option)
def entryconfigure(self, index, cnf=None, **kw): def entryconfigure(self, index, cnf=None, **kw):
"""Configure a menu item at INDEX.""" """Configure a menu item at INDEX."""

View File

@ -195,7 +195,7 @@ class InternalFunctionsTest(unittest.TestCase):
## Testing type = vsapi ## Testing type = vsapi
# vsapi type expects at least a class name and a part_id, so this # vsapi type expects at least a class name and a part_id, so this
# should raise an ValueError since it tries to get two elements from # should raise a ValueError since it tries to get two elements from
# an empty tuple # an empty tuple
self.assertRaises(ValueError, ttk._format_elemcreate, 'vsapi') self.assertRaises(ValueError, ttk._format_elemcreate, 'vsapi')

View File

@ -291,7 +291,7 @@ def _val_or_dict(tk, options, *args):
"""Format options then call Tk command with args and options and return """Format options then call Tk command with args and options and return
the appropriate result. the appropriate result.
If no option is specified, a dict is returned. If a option is If no option is specified, a dict is returned. If an option is
specified with the None value, the value for that option is returned. specified with the None value, the value for that option is returned.
Otherwise, the function just sets the passed options and the caller Otherwise, the function just sets the passed options and the caller
shouldn't be expecting a return value anyway.""" shouldn't be expecting a return value anyway."""
@ -1476,7 +1476,7 @@ class LabeledScale(Frame, object):
can be accessed through instance.label""" can be accessed through instance.label"""
def __init__(self, master=None, variable=None, from_=0, to=10, **kw): def __init__(self, master=None, variable=None, from_=0, to=10, **kw):
"""Construct an horizontal LabeledScale with parent master, a """Construct a horizontal LabeledScale with parent master, a
variable to be associated with the Ttk Scale widget and its range. variable to be associated with the Ttk Scale widget and its range.
If variable is not specified, a Tkinter.IntVar is created. If variable is not specified, a Tkinter.IntVar is created.

View File

@ -50,7 +50,7 @@ class BaseFix(object):
"""Initializer. Subclass may override. """Initializer. Subclass may override.
Args: Args:
options: an dict containing the options passed to RefactoringTool options: a dict containing the options passed to RefactoringTool
that could be used to customize the fixer through the command line. that could be used to customize the fixer through the command line.
log: a list to append warnings and other messages to. log: a list to append warnings and other messages to.
""" """

View File

@ -184,7 +184,7 @@ class RefactoringTool(object):
Args: Args:
fixer_names: a list of fixers to import fixer_names: a list of fixers to import
options: an dict with configuration. options: a dict with configuration.
explicit: a list of fixers to run even if they are explicit. explicit: a list of fixers to run even if they are explicit.
""" """
self.fixers = fixer_names self.fixers = fixer_names

View File

@ -1774,7 +1774,7 @@ class BabylMessage(Message):
"""Message with Babyl-specific properties.""" """Message with Babyl-specific properties."""
def __init__(self, message=None): def __init__(self, message=None):
"""Initialize an BabylMessage instance.""" """Initialize a BabylMessage instance."""
self._labels = [] self._labels = []
self._visible = Message() self._visible = Message()
Message.__init__(self, message) Message.__init__(self, message)

View File

@ -884,7 +884,7 @@ def RebuildProxy(func, token, serializer, kwds):
def MakeProxyType(name, exposed, _cache={}): def MakeProxyType(name, exposed, _cache={}):
''' '''
Return an proxy type whose methods are given by `exposed` Return a proxy type whose methods are given by `exposed`
''' '''
exposed = tuple(exposed) exposed = tuple(exposed)
try: try:

View File

@ -1375,7 +1375,7 @@ class OptionParser (OptionContainer):
sys.argv[1:]). Any errors result in a call to 'error()', which sys.argv[1:]). Any errors result in a call to 'error()', which
by default prints the usage message to stderr and calls by default prints the usage message to stderr and calls
sys.exit() with an error message. On success returns a pair sys.exit() with an error message. On success returns a pair
(values, args) where 'values' is an Values instance (with all (values, args) where 'values' is a Values instance (with all
your option values) and 'args' is the list of arguments left your option values) and 'args' is the list of arguments left
over after parsing options. over after parsing options.
""" """

View File

@ -329,7 +329,7 @@ def _parse_object(file):
################################################################# #################################################################
# #
# External - Create a form an link to an instance variable. # External - Create a form and link to an instance variable.
# #
def create_full_form(inst, (fdata, odatalist)): def create_full_form(inst, (fdata, odatalist)):
form = create_form(fdata) form = create_form(fdata)

View File

@ -328,7 +328,7 @@ def _parse_object(file):
################################################################# #################################################################
# #
# External - Create a form an link to an instance variable. # External - Create a form and link to an instance variable.
# #
def create_full_form(inst, (fdata, odatalist)): def create_full_form(inst, (fdata, odatalist)):
form = create_form(fdata) form = create_form(fdata)

View File

@ -102,7 +102,7 @@ class _Prop_version(aetools.NProperty):
files = file files = file
class internet_location_file(aetools.ComponentItem): class internet_location_file(aetools.ComponentItem):
"""internet location file - An file containing an internet location """ """internet location file - A file containing an internet location """
want = 'inlf' want = 'inlf'
class _Prop_location(aetools.NProperty): class _Prop_location(aetools.NProperty):
"""location - the internet location """ """location - the internet location """

View File

@ -58,7 +58,7 @@ class _Prop_application_file(aetools.NProperty):
application_processes = application_process application_processes = application_process
class desk_accessory_process(aetools.ComponentItem): class desk_accessory_process(aetools.ComponentItem):
"""desk accessory process - A process launched from an desk accessory file """ """desk accessory process - A process launched from a desk accessory file """
want = 'pcda' want = 'pcda'
class _Prop_desk_accessory_file(aetools.NProperty): class _Prop_desk_accessory_file(aetools.NProperty):
"""desk accessory file - a reference to the desk accessory file from which this process was launched """ """desk accessory file - a reference to the desk accessory file from which this process was launched """

View File

@ -549,7 +549,7 @@ def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT,
global default timeout setting returned by :func:`getdefaulttimeout` global default timeout setting returned by :func:`getdefaulttimeout`
is used. If *source_address* is set it must be a tuple of (host, port) is used. If *source_address* is set it must be a tuple of (host, port)
for the socket to bind as a source address before making the connection. for the socket to bind as a source address before making the connection.
An host of '' or port 0 tells the OS to use the default. A host of '' or port 0 tells the OS to use the default.
""" """
host, port = address host, port = address

View File

@ -229,7 +229,7 @@ class TextFactoryTestsWithEmbeddedZeroBytes(unittest.TestCase):
self.assertEqual(row[0], "a\x00b") self.assertEqual(row[0], "a\x00b")
def CheckCustom(self): def CheckCustom(self):
# A custom factory should receive an str argument # A custom factory should receive a str argument
self.con.text_factory = lambda x: x self.con.text_factory = lambda x: x
row = self.con.execute("select value from test").fetchone() row = self.con.execute("select value from test").fetchone()
self.assertIs(type(row[0]), str) self.assertIs(type(row[0]), str)

View File

@ -73,7 +73,7 @@ class RegressionTests(unittest.TestCase):
def CheckStatementFinalizationOnCloseDb(self): def CheckStatementFinalizationOnCloseDb(self):
# pysqlite versions <= 2.3.3 only finalized statements in the statement # pysqlite versions <= 2.3.3 only finalized statements in the statement
# cache when closing the database. statements that were still # cache when closing the database. statements that were still
# referenced in cursors weren't closed an could provoke " # referenced in cursors weren't closed and could provoke "
# "OperationalError: Unable to close due to unfinalised statements". # "OperationalError: Unable to close due to unfinalised statements".
con = sqlite.connect(":memory:") con = sqlite.connect(":memory:")
cursors = [] cursors = []

View File

@ -56,7 +56,7 @@ class Rat(object):
den = property(_get_den, None) den = property(_get_den, None)
def __repr__(self): def __repr__(self):
"""Convert a Rat to an string resembling a Rat constructor call.""" """Convert a Rat to a string resembling a Rat constructor call."""
return "Rat(%d, %d)" % (self.__num, self.__den) return "Rat(%d, %d)" % (self.__num, self.__den)
def __str__(self): def __str__(self):
@ -78,7 +78,7 @@ class Rat(object):
raise ValueError, "can't convert %s to int" % repr(self) raise ValueError, "can't convert %s to int" % repr(self)
def __long__(self): def __long__(self):
"""Convert a Rat to an long; self.den must be 1.""" """Convert a Rat to a long; self.den must be 1."""
if self.__den == 1: if self.__den == 1:
return long(self.__num) return long(self.__num)
raise ValueError, "can't convert %s to long" % repr(self) raise ValueError, "can't convert %s to long" % repr(self)

View File

@ -110,7 +110,7 @@ class samplecmdclass(cmd.Cmd):
5 12 19 5 12 19
6 13 6 13
This is a interactive test, put some commands in the cmdqueue attribute This is an interactive test, put some commands in the cmdqueue attribute
and let it execute and let it execute
This test includes the preloop(), postloop(), default(), emptyline(), This test includes the preloop(), postloop(), default(), emptyline(),
parseline(), do_help() functions parseline(), do_help() functions

View File

@ -47,7 +47,7 @@ class ReadTest(unittest.TestCase):
self.assertEqual(r.bytebuffer, "") self.assertEqual(r.bytebuffer, "")
self.assertEqual(r.charbuffer, u"") self.assertEqual(r.charbuffer, u"")
# do the check again, this time using a incremental decoder # do the check again, this time using an incremental decoder
d = codecs.getincrementaldecoder(self.encoding)() d = codecs.getincrementaldecoder(self.encoding)()
result = u"" result = u""
for (c, partialresult) in zip(input.encode(self.encoding), partialresults): for (c, partialresult) in zip(input.encode(self.encoding), partialresults):

View File

@ -951,7 +951,7 @@ the exception is in the output, but this will fail under Python 2:
HTTPException: message HTTPException: message
TestResults(failed=1, attempted=2) TestResults(failed=1, attempted=2)
But in Python 2 the module path is not included, an therefore a test must look But in Python 2 the module path is not included, and therefore a test must look
like the following test to succeed in Python 2. But that test will fail under like the following test to succeed in Python 2. But that test will fail under
Python 3. Python 3.

View File

@ -282,7 +282,7 @@ the function call setup. See <http://bugs.python.org/issue2016>.
>>> f(**x) >>> f(**x)
1 2 1 2
A obscure message: An obscure message:
>>> def f(a, b): >>> def f(a, b):
... pass ... pass

View File

@ -4,7 +4,7 @@ import os
# From SF bug #422121: Insecurities in dict comparison. # From SF bug #422121: Insecurities in dict comparison.
# Safety of code doing comparisons has been an historical Python weak spot. # Safety of code doing comparisons has been a historical Python weak spot.
# The problem is that comparison of structures written in C *naturally* # The problem is that comparison of structures written in C *naturally*
# wants to hold on to things like the size of the container, or "the # wants to hold on to things like the size of the container, or "the
# biggest" containee so far, across a traversal of the container; but # biggest" containee so far, across a traversal of the container; but

View File

@ -463,7 +463,7 @@ class SysModuleTest(unittest.TestCase):
self.assertEqual(os.path.abspath(sys.executable), sys.executable) self.assertEqual(os.path.abspath(sys.executable), sys.executable)
# Issue #7774: Ensure that sys.executable is an empty string if argv[0] # Issue #7774: Ensure that sys.executable is an empty string if argv[0]
# has been set to an non existent program name and Python is unable to # has been set to a non existent program name and Python is unable to
# retrieve the real program name # retrieve the real program name
import subprocess import subprocess
# For a normal installation, it should work without 'cwd' # For a normal installation, it should work without 'cwd'

View File

@ -876,7 +876,7 @@ class EventTests(lock_tests.EventTests):
eventtype = staticmethod(threading.Event) eventtype = staticmethod(threading.Event)
class ConditionAsRLockTests(lock_tests.RLockTests): class ConditionAsRLockTests(lock_tests.RLockTests):
# An Condition uses an RLock by default and exports its API. # Condition uses an RLock by default and exports its API.
locktype = staticmethod(threading.Condition) locktype = staticmethod(threading.Condition)
class ConditionTests(lock_tests.ConditionTests): class ConditionTests(lock_tests.ConditionTests):

View File

@ -358,7 +358,7 @@ del modules, mod_dict
# tuple. # tuple.
# #
# @param value The time, given as an ISO 8601 string, a time # @param value The time, given as an ISO 8601 string, a time
# tuple, or a integer time value. # tuple, or an integer time value.
def _strftime(value): def _strftime(value):
if datetime: if datetime:
@ -1616,7 +1616,7 @@ class ServerProxy:
# magic method dispatcher # magic method dispatcher
return _Method(self.__request, name) return _Method(self.__request, name)
# note: to call a remote object with an non-standard name, use # note: to call a remote object with a non-standard name, use
# result getattr(server, "strange-python-name")(args) # result getattr(server, "strange-python-name")(args)
def __call__(self, attr): def __call__(self, attr):

View File

@ -20,7 +20,7 @@ class Special_Events_Events:
} }
def mount(self, _object, _attributes={}, **_arguments): def mount(self, _object, _attributes={}, **_arguments):
"""mount: Mounts an Disk Copy image as a disk volume """mount: Mounts a Disk Copy image as a disk volume
Required argument: a reference to the disk image to be mounted Required argument: a reference to the disk image to be mounted
Keyword argument access_mode: the access mode for mounted volume (default is "any", i.e. best possible) Keyword argument access_mode: the access mode for mounted volume (default is "any", i.e. best possible)
Keyword argument checksum_verification: Verify the checksum before mounting? Keyword argument checksum_verification: Verify the checksum before mounting?

View File

@ -3096,7 +3096,7 @@ Core and builtins
would not be removed while allocating a new weakref object. Since would not be removed while allocating a new weakref object. Since
GC could be invoked at that time, however, that assumption was GC could be invoked at that time, however, that assumption was
invalid. In a truly obscure case of GC being triggered during invalid. In a truly obscure case of GC being triggered during
creation for a new weakref object for an referent which already creation for a new weakref object for a referent which already
has a weakref without a callback which is only referenced from has a weakref without a callback which is only referenced from
cyclic trash, a memory error can occur. This consistently created a cyclic trash, a memory error can occur. This consistently created a
segfault in a debug build, but provided less predictable behavior in segfault in a debug build, but provided less predictable behavior in
@ -7825,7 +7825,7 @@ Standard library
- xml.dom.minidom offers a toprettyxml method. A number of DOM - xml.dom.minidom offers a toprettyxml method. A number of DOM
conformance issues have been resolved. In particular, Element now conformance issues have been resolved. In particular, Element now
has an hasAttributes method, and the handling of namespaces was has a hasAttributes method, and the handling of namespaces was
improved. improved.
- Ka-Ping Yee contributed two new modules: inspect.py, a module for - Ka-Ping Yee contributed two new modules: inspect.py, a module for
@ -9315,7 +9315,7 @@ list of all new modules is included below.
Probably the most pervasive change is the addition of Unicode support. Probably the most pervasive change is the addition of Unicode support.
We've added a new fundamental datatype, the Unicode string, a new We've added a new fundamental datatype, the Unicode string, a new
build-in function unicode(), an numerous C APIs to deal with Unicode built-in function unicode(), a numerous C APIs to deal with Unicode
and encodings. See the file Misc/unicode.txt for details, or and encodings. See the file Misc/unicode.txt for details, or
http://starship.python.net/crew/lemburg/unicode-proposal.txt. http://starship.python.net/crew/lemburg/unicode-proposal.txt.
@ -10800,7 +10800,7 @@ real list objects.
- The uu module now deals better with trailing garbage generated by - The uu module now deals better with trailing garbage generated by
some broke uuencoders. some broke uuencoders.
- The telnet module now has an my_interact() method which uses threads - The telnet module now has a my_interact() method which uses threads
instead of select. The interact() method uses this by default on instead of select. The interact() method uses this by default on
Windows (where the single-threaded version doesn't work). Windows (where the single-threaded version doesn't work).
@ -11857,7 +11857,7 @@ PyEval_CallMethod().
- New macros to access object members for PyFunction, PyCFunction - New macros to access object members for PyFunction, PyCFunction
objects. objects.
- New APIs PyImport_AppendInittab() an PyImport_ExtendInittab() to - New APIs PyImport_AppendInittab() and PyImport_ExtendInittab() to
dynamically add one or many entries to the table of built-in modules. dynamically add one or many entries to the table of built-in modules.
- New macro Py_InitModule3(name, methods, doc) which calls - New macro Py_InitModule3(name, methods, doc) which calls
@ -16267,7 +16267,7 @@ a string it is returned unchanged, otherwise it returns `x`.
* repr(x) returns the same as `x`. (Some users found it easier to * repr(x) returns the same as `x`. (Some users found it easier to
have this as a function.) have this as a function.)
* round(x) returns the floating point number x rounded to an whole * round(x) returns the floating point number x rounded to a whole
number, represented as a floating point number. round(x, n) returns x number, represented as a floating point number. round(x, n) returns x
rounded to n digits. rounded to n digits.

View File

@ -717,7 +717,7 @@ parse_process_char(ReaderObj *self, char c)
break; break;
case QUOTE_IN_QUOTED_FIELD: case QUOTE_IN_QUOTED_FIELD:
/* doublequote - seen a quote in an quoted field */ /* doublequote - seen a quote in a quoted field */
if (dialect->quoting != QUOTE_NONE && if (dialect->quoting != QUOTE_NONE &&
c == dialect->quotechar) { c == dialect->quotechar) {
/* save "" as " */ /* save "" as " */

View File

@ -3899,7 +3899,7 @@ PyCFuncPtr_call(PyCFuncPtrObject *self, PyObject *inargs, PyObject *kwds)
return NULL; return NULL;
} }
/* there should be more checks? No, in Python */ /* there should be more checks? No, in Python */
/* First arg is an pointer to an interface instance */ /* First arg is a pointer to an interface instance */
if (!this->b_ptr || *(void **)this->b_ptr == NULL) { if (!this->b_ptr || *(void **)this->b_ptr == NULL) {
PyErr_SetString(PyExc_ValueError, PyErr_SetString(PyExc_ValueError,
"NULL COM pointer access"); "NULL COM pointer access");

View File

@ -3444,7 +3444,7 @@ load_bool(Unpicklerobject *self, PyObject *boolean)
/* s contains x bytes of a little-endian integer. Return its value as a /* s contains x bytes of a little-endian integer. Return its value as a
* C int. Obscure: when x is 1 or 2, this is an unsigned little-endian * C int. Obscure: when x is 1 or 2, this is an unsigned little-endian
* int, but when x is 4 it's a signed one. This is an historical source * int, but when x is 4 it's a signed one. This is a historical source
* of x-platform bugs. * of x-platform bugs.
*/ */
static long static long

View File

@ -2883,7 +2883,7 @@ bytearray(string, encoding[, errors]) -> bytearray.\n\
bytearray(bytes_or_bytearray) -> mutable copy of bytes_or_bytearray.\n\ bytearray(bytes_or_bytearray) -> mutable copy of bytes_or_bytearray.\n\
bytearray(memory_view) -> bytearray.\n\ bytearray(memory_view) -> bytearray.\n\
\n\ \n\
Construct an mutable bytearray object from:\n\ Construct a mutable bytearray object from:\n\
- an iterable yielding integers in range(256)\n\ - an iterable yielding integers in range(256)\n\
- a text string encoded using the specified encoding\n\ - a text string encoded using the specified encoding\n\
- a bytes or a bytearray object\n\ - a bytes or a bytearray object\n\

View File

@ -1310,7 +1310,7 @@ static PyTypeObject PyFieldNameIter_Type = {
0}; 0};
/* unicode_formatter_field_name_split is used to implement /* unicode_formatter_field_name_split is used to implement
string.Formatter.vformat. it takes an PEP 3101 "field name", and string.Formatter.vformat. it takes a PEP 3101 "field name", and
returns a tuple of (first, rest): "first", the part before the returns a tuple of (first, rest): "first", the part before the
first '.' or '['; and "rest", an iterator for the rest of the field first '.' or '['; and "rest", an iterator for the rest of the field
name. it's a wrapper around stringlib/string_format.h's name. it's a wrapper around stringlib/string_format.h's

View File

@ -301,7 +301,7 @@ PyDoc_STRVAR(SetValueEx_doc,
" REG_EXPAND_SZ -- A null-terminated string that contains unexpanded references\n" " REG_EXPAND_SZ -- A null-terminated string that contains unexpanded references\n"
" to environment variables (for example, %PATH%).\n" " to environment variables (for example, %PATH%).\n"
" REG_LINK -- A Unicode symbolic link.\n" " REG_LINK -- A Unicode symbolic link.\n"
" REG_MULTI_SZ -- An sequence of null-terminated strings, terminated by\n" " REG_MULTI_SZ -- A sequence of null-terminated strings, terminated by\n"
" two null characters. Note that Python handles this\n" " two null characters. Note that Python handles this\n"
" termination automatically.\n" " termination automatically.\n"
" REG_NONE -- No defined value type.\n" " REG_NONE -- No defined value type.\n"

View File

@ -178,7 +178,7 @@ PyThread_start_new_thread(void (*func)(void *), void *arg)
} }
/* /*
* Return the thread Id instead of an handle. The Id is said to uniquely identify the * Return the thread Id instead of a handle. The Id is said to uniquely identify the
* thread in the system * thread in the system
*/ */
long long

View File

@ -42,7 +42,7 @@ long PyThread_start_new_thread(void (*func)(void *), void *arg)
} }
/* /*
* Return the thread Id instead of an handle. The Id is said to uniquely identify the * Return the thread Id instead of a handle. The Id is said to uniquely identify the
* thread in the system * thread in the system
*/ */
long PyThread_get_thread_ident(void) long PyThread_get_thread_ident(void)

View File

@ -84,7 +84,7 @@ class NullPyObjectPtr(RuntimeError):
def safety_limit(val): def safety_limit(val):
# Given a integer value from the process being debugged, limit it to some # Given an integer value from the process being debugged, limit it to some
# safety threshold so that arbitrary breakage within said process doesn't # safety threshold so that arbitrary breakage within said process doesn't
# break the gdb process too much (e.g. sizes of iterations, sizes of lists) # break the gdb process too much (e.g. sizes of iterations, sizes of lists)
return min(val, 1000) return min(val, 1000)
@ -132,7 +132,7 @@ class TruncatedStringIO(object):
class PyObjectPtr(object): class PyObjectPtr(object):
""" """
Class wrapping a gdb.Value that's a either a (PyObject*) within the Class wrapping a gdb.Value that's either a (PyObject*) within the
inferior process, or some subclass pointer e.g. (PyStringObject*) inferior process, or some subclass pointer e.g. (PyStringObject*)
There will be a subclass for every refined PyObject type that we care There will be a subclass for every refined PyObject type that we care

View File

@ -259,7 +259,7 @@ def remove_old_versions(db):
# either both per-machine or per-user. # either both per-machine or per-user.
migrate_features = 1 migrate_features = 1
# See "Upgrade Table". We remove releases with the same major and # See "Upgrade Table". We remove releases with the same major and
# minor version. For an snapshot, we remove all earlier snapshots. For # minor version. For a snapshot, we remove all earlier snapshots. For
# a release, we remove all snapshots, and all earlier releases. # a release, we remove all snapshots, and all earlier releases.
if snapshot: if snapshot:
add_data(db, "Upgrade", add_data(db, "Upgrade",