Python-checkins
Threads by month
- ----- 2026 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
November 2015
- 8 participants
- 573 discussions
Nov. 2, 2015
Results for project Python default, build date 2015-11-02 10:18:08 +0000
commit: 83fa2e9b0038db72dc29be5fbcfcb126841c3b05
revision date: 2015-11-02 05:39:56 +0000
environment: Haswell-EP
cpu: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB
mem: 128 GB
os: CentOS 7.1
kernel: Linux 3.10.0-229.4.2.el7.x86_64
Baseline results were generated using release v3.4.3, with hash
b4cbecbc0781e89a309d03b60a1f75f8499250e6 from 2015-02-25 12:15:33+00:00
----------------------------------------------------------------------------------
benchmark relative change since change since current rev run
std_dev* last run baseline with PGO
----------------------------------------------------------------------------------
:-) django_v2 0.33% -0.11% 7.54% 16.65%
:-( pybench 0.11% 0.09% -2.27% 9.23%
:-( regex_v8 2.70% 0.26% -4.34% 5.02%
:-( nbody 0.15% 0.70% -2.46% 10.29%
:-( json_dump_v2 0.33% -1.31% -2.22% 9.21%
:-| normal_startup 0.86% -0.38% -0.35% 5.83%
----------------------------------------------------------------------------------
Note: Benchmark results are measured in seconds.
* Relative Standard Deviation (Standard Deviation/Average)
Our lab does a nightly source pull and build of the Python project and measures
performance changes against the previous stable version and the previous nightly
measurement. This is provided as a service to the community so that quality
issues with current hardware can be identified quickly.
Intel technologies' features and benefits depend on system configuration and may
require enabled hardware, software or service activation. Performance varies
depending on system configuration.
1
0
Nov. 2, 2015
https://hg.python.org/cpython/rev/75df8b0a2cd1
changeset: 98936:75df8b0a2cd1
branch: 3.4
parent: 98928:d8ff13414deb
user: Serhiy Storchaka <storchaka(a)gmail.com>
date: Mon Nov 02 14:10:23 2015 +0200
summary:
Issue #25523: Further a-to-an corrections.
files:
Doc/distutils/packageindex.rst | 2 +-
Doc/howto/descriptor.rst | 2 +-
Doc/install/index.rst | 2 +-
Doc/library/asyncio-protocol.rst | 2 +-
Doc/library/contextlib.rst | 2 +-
Doc/library/email.parser.rst | 4 ++--
Doc/library/gzip.rst | 2 +-
Doc/library/pickle.rst | 4 ++--
Doc/library/socket.rst | 4 ++--
Doc/library/tokenize.rst | 2 +-
Doc/library/unittest.rst | 2 +-
Doc/library/urllib.request.rst | 2 +-
Doc/library/xml.dom.minidom.rst | 2 +-
Doc/library/zlib.rst | 2 +-
Doc/whatsnew/2.7.rst | 2 +-
Doc/whatsnew/3.3.rst | 2 +-
Include/unicodeobject.h | 4 ++--
Lib/asyncio/sslproto.py | 2 +-
Lib/asyncio/transports.py | 2 +-
Lib/ctypes/test/test_random_things.py | 2 +-
Lib/http/cookiejar.py | 2 +-
Lib/lib2to3/fixes/fix_metaclass.py | 2 +-
Lib/msilib/schema.py | 2 +-
Lib/test/regrtest.py | 2 +-
Lib/test/test_dict.py | 2 +-
Lib/test/test_io.py | 2 +-
Lib/test/test_socket.py | 2 +-
Lib/test/test_userdict.py | 2 +-
Lib/tkinter/__init__.py | 2 +-
Misc/HISTORY | 2 +-
Misc/NEWS | 2 +-
Modules/_ssl.c | 2 +-
Modules/itertoolsmodule.c | 2 +-
Objects/unicodeobject.c | 4 ++--
34 files changed, 39 insertions(+), 39 deletions(-)
diff --git a/Doc/distutils/packageindex.rst b/Doc/distutils/packageindex.rst
--- a/Doc/distutils/packageindex.rst
+++ b/Doc/distutils/packageindex.rst
@@ -167,7 +167,7 @@
username: <username>
password: <password>
-The *distutils* section defines a *index-servers* variable that lists the
+The *distutils* section defines an *index-servers* variable that lists the
name of all sections describing a repository.
Each section describing a repository defines three variables:
diff --git a/Doc/howto/descriptor.rst b/Doc/howto/descriptor.rst
--- a/Doc/howto/descriptor.rst
+++ b/Doc/howto/descriptor.rst
@@ -319,7 +319,7 @@
patterns of binding functions into methods.
To recap, functions have a :meth:`__get__` method so that they can be converted
-to a method when accessed as attributes. The non-data descriptor transforms a
+to a method when accessed as attributes. The non-data descriptor transforms an
``obj.f(*args)`` call into ``f(obj, *args)``. Calling ``klass.f(*args)``
becomes ``f(*args)``.
diff --git a/Doc/install/index.rst b/Doc/install/index.rst
--- a/Doc/install/index.rst
+++ b/Doc/install/index.rst
@@ -148,7 +148,7 @@
On Windows, you'd probably download :file:`foo-1.0.zip`. If you downloaded the
archive file to :file:`C:\\Temp`, then it would unpack into
-:file:`C:\\Temp\\foo-1.0`; you can use either a archive manipulator with a
+:file:`C:\\Temp\\foo-1.0`; you can use either an archive manipulator with a
graphical user interface (such as WinZip) or a command-line tool (such as
:program:`unzip` or :program:`pkunzip`) to unpack the archive. Then, open a
command prompt window and run::
diff --git a/Doc/library/asyncio-protocol.rst b/Doc/library/asyncio-protocol.rst
--- a/Doc/library/asyncio-protocol.rst
+++ b/Doc/library/asyncio-protocol.rst
@@ -148,7 +148,7 @@
high-water limit. Neither *high* nor *low* can be negative.
The defaults are implementation-specific. If only the
- high-water limit is given, the low-water limit defaults to a
+ high-water limit is given, the low-water limit defaults to an
implementation-specific value less than or equal to the
high-water limit. Setting *high* to zero forces *low* to zero as
well, and causes :meth:`pause_writing` to be called whenever the
diff --git a/Doc/library/contextlib.rst b/Doc/library/contextlib.rst
--- a/Doc/library/contextlib.rst
+++ b/Doc/library/contextlib.rst
@@ -142,7 +142,7 @@
is hardwired to stdout.
For example, the output of :func:`help` normally is sent to *sys.stdout*.
- You can capture that output in a string by redirecting the output to a
+ You can capture that output in a string by redirecting the output to an
:class:`io.StringIO` object::
f = io.StringIO()
diff --git a/Doc/library/email.parser.rst b/Doc/library/email.parser.rst
--- a/Doc/library/email.parser.rst
+++ b/Doc/library/email.parser.rst
@@ -146,7 +146,7 @@
methods on file-like objects.
The text contained in *fp* must be formatted as a block of :rfc:`2822`
- style headers and header continuation lines, optionally preceded by a
+ style headers and header continuation lines, optionally preceded by an
envelope header. The header block is terminated either by the end of the
data or by a blank line. Following the header block is the body of the
message (which may contain MIME-encoded subparts).
@@ -189,7 +189,7 @@
methods on file-like objects.
The bytes contained in *fp* must be formatted as a block of :rfc:`2822`
- style headers and header continuation lines, optionally preceded by a
+ style headers and header continuation lines, optionally preceded by an
envelope header. The header block is terminated either by the end of the
data or by a blank line. Following the header block is the body of the
message (which may contain MIME-encoded subparts, including subparts
diff --git a/Doc/library/gzip.rst b/Doc/library/gzip.rst
--- a/Doc/library/gzip.rst
+++ b/Doc/library/gzip.rst
@@ -64,7 +64,7 @@
method. At least one of *fileobj* and *filename* must be given a non-trivial
value.
- The new class instance is based on *fileobj*, which can be a regular file, a
+ The new class instance is based on *fileobj*, which can be a regular file, an
:class:`io.BytesIO` object, or any other object which simulates a file. It
defaults to ``None``, in which case *filename* is opened to provide a file
object.
diff --git a/Doc/library/pickle.rst b/Doc/library/pickle.rst
--- a/Doc/library/pickle.rst
+++ b/Doc/library/pickle.rst
@@ -192,7 +192,7 @@
number is specified, :data:`HIGHEST_PROTOCOL` is selected.
The *file* argument must have a write() method that accepts a single bytes
- argument. It can thus be an on-disk file opened for binary writing, a
+ argument. It can thus be an on-disk file opened for binary writing, an
:class:`io.BytesIO` instance, or any other custom object that meets this
interface.
@@ -288,7 +288,7 @@
number is specified, :data:`HIGHEST_PROTOCOL` is selected.
The *file* argument must have a write() method that accepts a single bytes
- argument. It can thus be an on-disk file opened for binary writing, a
+ argument. It can thus be an on-disk file opened for binary writing, an
:class:`io.BytesIO` instance, or any other custom object that meets this
interface.
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -762,7 +762,7 @@
.. function:: sethostname(name)
- Set the machine's hostname to *name*. This will raise a
+ Set the machine's hostname to *name*. This will raise an
:exc:`OSError` if you don't have enough rights.
Availability: Unix.
@@ -794,7 +794,7 @@
.. function:: if_indextoname(if_index)
- Return a network interface name corresponding to a
+ Return a network interface name corresponding to an
interface index number.
:exc:`OSError` if no interface with the given index exists.
diff --git a/Doc/library/tokenize.rst b/Doc/library/tokenize.rst
--- a/Doc/library/tokenize.rst
+++ b/Doc/library/tokenize.rst
@@ -41,7 +41,7 @@
returned as a :term:`named tuple` with the field names:
``type string start end line``.
- The returned :term:`named tuple` has a additional property named
+ The returned :term:`named tuple` has an additional property named
``exact_type`` that contains the exact operator type for
:data:`token.OP` tokens. For all other token types ``exact_type``
equals the named tuple ``type`` field.
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -464,7 +464,7 @@
.. versionadded:: 3.1
Unittest supports skipping individual test methods and even whole classes of
-tests. In addition, it supports marking a test as a "expected failure," a test
+tests. In addition, it supports marking a test as an "expected failure," a test
that is broken and will fail, but shouldn't be counted as a failure on a
:class:`TestResult`.
diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst
--- a/Doc/library/urllib.request.rst
+++ b/Doc/library/urllib.request.rst
@@ -1322,7 +1322,7 @@
.. method:: retrieve(url, filename=None, reporthook=None, data=None)
Retrieves the contents of *url* and places it in *filename*. The return value
- is a tuple consisting of a local filename and either a
+ is a tuple consisting of a local filename and either an
:class:`email.message.Message` object containing the response headers (for remote
URLs) or ``None`` (for local URLs). The caller must then open and read the
contents of *filename*. If *filename* is not given and the URL refers to a
diff --git a/Doc/library/xml.dom.minidom.rst b/Doc/library/xml.dom.minidom.rst
--- a/Doc/library/xml.dom.minidom.rst
+++ b/Doc/library/xml.dom.minidom.rst
@@ -54,7 +54,7 @@
.. function:: parseString(string, parser=None)
- Return a :class:`Document` that represents the *string*. This method creates a
+ Return a :class:`Document` that represents the *string*. This method creates an
:class:`io.StringIO` object for the string and passes that on to :func:`parse`.
Both functions return a :class:`Document` object representing the content of the
diff --git a/Doc/library/zlib.rst b/Doc/library/zlib.rst
--- a/Doc/library/zlib.rst
+++ b/Doc/library/zlib.rst
@@ -30,7 +30,7 @@
.. function:: adler32(data[, value])
- Computes a Adler-32 checksum of *data*. (An Adler-32 checksum is almost as
+ Computes an Adler-32 checksum of *data*. (An Adler-32 checksum is almost as
reliable as a CRC32 but can be computed much more quickly.) If *value* is
present, it is used as the starting value of the checksum; otherwise, a fixed
default value is used. This allows computing a running checksum over the
diff --git a/Doc/whatsnew/2.7.rst b/Doc/whatsnew/2.7.rst
--- a/Doc/whatsnew/2.7.rst
+++ b/Doc/whatsnew/2.7.rst
@@ -1118,7 +1118,7 @@
(Fixed by Daniel Stutzbach; :issue:`8729`.)
* Constructors for the parsing classes in the :mod:`ConfigParser` module now
- take a *allow_no_value* parameter, defaulting to false; if true,
+ take an *allow_no_value* parameter, defaulting to false; if true,
options without values will be allowed. For example::
>>> import ConfigParser, StringIO
diff --git a/Doc/whatsnew/3.3.rst b/Doc/whatsnew/3.3.rst
--- a/Doc/whatsnew/3.3.rst
+++ b/Doc/whatsnew/3.3.rst
@@ -2155,7 +2155,7 @@
* encode an ASCII string to UTF-8 doesn't need to encode characters anymore,
the UTF-8 representation is shared with the ASCII representation
* the UTF-8 encoder has been optimized
- * repeating a single ASCII letter and getting a substring of a ASCII strings
+ * repeating a single ASCII letter and getting a substring of an ASCII string
is 4 times faster
* UTF-8 is now 2x to 4x faster. UTF-16 encoding is now up to 10x faster.
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -965,7 +965,7 @@
Py_ssize_t end
);
-/* Append a ASCII-encoded byte string.
+/* Append an ASCII-encoded byte string.
Return 0 on success, raise an exception and return -1 on error. */
PyAPI_FUNC(int)
_PyUnicodeWriter_WriteASCIIString(_PyUnicodeWriter *writer,
@@ -2041,7 +2041,7 @@
int op /* Operation: Py_EQ, Py_NE, Py_GT, etc. */
);
-/* Apply a argument tuple or dictionary to a format string and return
+/* Apply an argument tuple or dictionary to a format string and return
the resulting Unicode string. */
PyAPI_FUNC(PyObject *) PyUnicode_Format(
diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py
--- a/Lib/asyncio/sslproto.py
+++ b/Lib/asyncio/sslproto.py
@@ -349,7 +349,7 @@
high-water limit. Neither value can be negative.
The defaults are implementation-specific. If only the
- high-water limit is given, the low-water limit defaults to a
+ high-water limit is given, the low-water limit defaults to an
implementation-specific value less than or equal to the
high-water limit. Setting high to zero forces low to zero as
well, and causes pause_writing() to be called whenever the
diff --git a/Lib/asyncio/transports.py b/Lib/asyncio/transports.py
--- a/Lib/asyncio/transports.py
+++ b/Lib/asyncio/transports.py
@@ -62,7 +62,7 @@
high-water limit. Neither value can be negative.
The defaults are implementation-specific. If only the
- high-water limit is given, the low-water limit defaults to a
+ high-water limit is given, the low-water limit defaults to an
implementation-specific value less than or equal to the
high-water limit. Setting high to zero forces low to zero as
well, and causes pause_writing() to be called whenever the
diff --git a/Lib/ctypes/test/test_random_things.py b/Lib/ctypes/test/test_random_things.py
--- a/Lib/ctypes/test/test_random_things.py
+++ b/Lib/ctypes/test/test_random_things.py
@@ -30,7 +30,7 @@
# value is printed correctly.
#
# Changed in 0.9.3: No longer is '(in callback)' prepended to the
- # error message - instead a additional frame for the C code is
+ # error message - instead an additional frame for the C code is
# created, then a full traceback printed. When SystemExit is
# raised in a callback function, the interpreter exits.
diff --git a/Lib/http/cookiejar.py b/Lib/http/cookiejar.py
--- a/Lib/http/cookiejar.py
+++ b/Lib/http/cookiejar.py
@@ -1437,7 +1437,7 @@
break
# convert RFC 2965 Max-Age to seconds since epoch
# XXX Strictly you're supposed to follow RFC 2616
- # age-calculation rules. Remember that zero Max-Age is a
+ # age-calculation rules. Remember that zero Max-Age
# is a request to discard (old and new) cookie, though.
k = "expires"
v = self._now + v
diff --git a/Lib/lib2to3/fixes/fix_metaclass.py b/Lib/lib2to3/fixes/fix_metaclass.py
--- a/Lib/lib2to3/fixes/fix_metaclass.py
+++ b/Lib/lib2to3/fixes/fix_metaclass.py
@@ -114,7 +114,7 @@
left_node = expr_node.children[0]
if isinstance(left_node, Leaf) and \
left_node.value == '__metaclass__':
- # We found a assignment to __metaclass__.
+ # We found an assignment to __metaclass__.
fixup_simple_stmt(node, i, simple_node)
remove_trailing_newline(simple_node)
yield (node, i, simple_node)
diff --git a/Lib/msilib/schema.py b/Lib/msilib/schema.py
--- a/Lib/msilib/schema.py
+++ b/Lib/msilib/schema.py
@@ -733,7 +733,7 @@
('CustomAction','Source','Y',None, None, None, None, 'CustomSource',None, 'The table reference of the source of the code.',),
('CustomAction','Target','Y',None, None, None, None, 'Formatted',None, 'Excecution parameter, depends on the type of custom action',),
('DrLocator','Signature_','N',None, None, None, None, 'Identifier',None, 'The Signature_ represents a unique file signature and is also the foreign key in the Signature table.',),
-('DrLocator','Path','Y',None, None, None, None, 'AnyPath',None, 'The path on the user system. This is a either a subpath below the value of the Parent or a full path. The path may contain properties enclosed within [ ] that will be expanded.',),
+('DrLocator','Path','Y',None, None, None, None, 'AnyPath',None, 'The path on the user system. This is either a subpath below the value of the Parent or a full path. The path may contain properties enclosed within [ ] that will be expanded.',),
('DrLocator','Depth','Y',0,32767,None, None, None, None, 'The depth below the path to which the Signature_ is recursively searched. If absent, the depth is assumed to be 0.',),
('DrLocator','Parent','Y',None, None, None, None, 'Identifier',None, 'The parent file signature. It is also a foreign key in the Signature table. If null and the Path column does not expand to a full path, then all the fixed drives of the user system are searched using the Path.',),
('DuplicateFile','File_','N',None, None, 'File',1,'Identifier',None, 'Foreign key referencing the source file to be duplicated.',),
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -27,7 +27,7 @@
EPILOG = """\
Additional option details:
--r randomizes test execution order. You can use --randseed=int to provide a
+-r randomizes test execution order. You can use --randseed=int to provide an
int seed value for the randomizer; this is useful for reproducing troublesome
test orders.
diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py
--- a/Lib/test/test_dict.py
+++ b/Lib/test/test_dict.py
@@ -603,7 +603,7 @@
# (D) subclass defines __missing__ method returning a value
# (E) subclass defines __missing__ method raising RuntimeError
# (F) subclass sets __missing__ instance variable (no effect)
- # (G) subclass doesn't define __missing__ at a all
+ # (G) subclass doesn't define __missing__ at all
class D(dict):
def __missing__(self, key):
return 42
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -15,7 +15,7 @@
################################################################################
# When writing tests for io, it's important to test both the C and Python
# implementations. This is usually done by writing a base test that refers to
-# the type it is testing as a attribute. Then it provides custom subclasses to
+# the type it is testing as an attribute. Then it provides custom subclasses to
# test both implementations. This file has lots of examples.
################################################################################
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -4651,7 +4651,7 @@
except OSError as e:
if str(e) == "AF_UNIX path too long":
self.skipTest(
- "Pathname {0!a} is too long to serve as a AF_UNIX path"
+ "Pathname {0!a} is too long to serve as an AF_UNIX path"
.format(path))
else:
raise
diff --git a/Lib/test/test_userdict.py b/Lib/test/test_userdict.py
--- a/Lib/test/test_userdict.py
+++ b/Lib/test/test_userdict.py
@@ -171,7 +171,7 @@
# (D) subclass defines __missing__ method returning a value
# (E) subclass defines __missing__ method raising RuntimeError
# (F) subclass sets __missing__ instance variable (no effect)
- # (G) subclass doesn't define __missing__ at a all
+ # (G) subclass doesn't define __missing__ at all
class D(collections.UserDict):
def __missing__(self, key):
return 42
diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py
--- a/Lib/tkinter/__init__.py
+++ b/Lib/tkinter/__init__.py
@@ -1117,7 +1117,7 @@
return self._bind(('bind', className), sequence, func, add, 0)
def unbind_class(self, className, sequence):
- """Unbind for a all widgets with bindtag CLASSNAME for event SEQUENCE
+ """Unbind for all widgets with bindtag CLASSNAME for event SEQUENCE
all functions."""
self.tk.call('bind', className , sequence, '')
def mainloop(self, n=0):
diff --git a/Misc/HISTORY b/Misc/HISTORY
--- a/Misc/HISTORY
+++ b/Misc/HISTORY
@@ -12379,7 +12379,7 @@
- Bug #1194181: bz2.BZ2File didn't handle mode 'U' correctly.
-- Patch #1212117: os.stat().st_flags is now accessible as a attribute
+- Patch #1212117: os.stat().st_flags is now accessible as an attribute
if available on the platform.
- Patch #1103951: Expose O_SHLOCK and O_EXLOCK in the posix module if
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -1008,7 +1008,7 @@
Changes are written to HOME/.idlerc/config-extensions.cfg.
Original patch by Tal Einat.
-- Issue #16233: A module browser (File : Class Browser, Alt+C) requires a
+- Issue #16233: A module browser (File : Class Browser, Alt+C) requires an
editor window with a filename. When Class Browser is requested otherwise,
from a shell, output window, or 'Untitled' editor, Idle no longer displays
an error box. It now pops up an Open Module box (Alt+M). If a valid name
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -2693,7 +2693,7 @@
cadata_ascii = PyUnicode_AsASCIIString(cadata);
if (cadata_ascii == NULL) {
PyErr_SetString(PyExc_TypeError,
- "cadata should be a ASCII string or a "
+ "cadata should be an ASCII string or a "
"bytes-like object");
goto error;
}
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -1725,7 +1725,7 @@
"starmap(function, sequence) --> starmap object\n\
\n\
Return an iterator whose values are returned from the function evaluated\n\
-with a argument tuple taken from the given sequence.");
+with an argument tuple taken from the given sequence.");
static PyTypeObject starmap_type = {
PyVarObject_HEAD_INIT(NULL, 0)
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -1703,7 +1703,7 @@
return unicode_resize(p_unicode, length);
}
-/* Copy a ASCII or latin1 char* string into a Python Unicode string.
+/* Copy an ASCII or latin1 char* string into a Python Unicode string.
WARNING: The function doesn't copy the terminating null character and
doesn't check the maximum character (may write a latin1 character in an
@@ -7290,7 +7290,7 @@
}
/*
- * Encode a Unicode string to a Windows code page into a byte string using a
+ * Encode a Unicode string to a Windows code page into a byte string using an
* error handler.
*
* Returns consumed characters if succeed, or raise an OSError and returns
--
Repository URL: https://hg.python.org/cpython
1
0
cpython (3.5): Issue #25523: Further a-to-an corrections new in 3.5.
by serhiy.storchaka Nov. 2, 2015
by serhiy.storchaka Nov. 2, 2015
Nov. 2, 2015
https://hg.python.org/cpython/rev/a0d0f968b020
changeset: 98938:a0d0f968b020
branch: 3.5
user: Serhiy Storchaka <storchaka(a)gmail.com>
date: Mon Nov 02 14:40:41 2015 +0200
summary:
Issue #25523: Further a-to-an corrections new in 3.5.
files:
Doc/library/glob.rst | 2 +-
Lib/test/test_asdl_parser.py | 2 +-
Misc/NEWS | 2 +-
Modules/_ssl.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/Doc/library/glob.rst b/Doc/library/glob.rst
--- a/Doc/library/glob.rst
+++ b/Doc/library/glob.rst
@@ -38,7 +38,7 @@
symlinks are included in the results (as in the shell).
If *recursive* is true, the pattern "``**``" will match any files and zero or
- more directories and subdirectories. If the pattern is followed by a
+ more directories and subdirectories. If the pattern is followed by an
``os.sep``, only directories and subdirectories match.
.. note::
diff --git a/Lib/test/test_asdl_parser.py b/Lib/test/test_asdl_parser.py
--- a/Lib/test/test_asdl_parser.py
+++ b/Lib/test/test_asdl_parser.py
@@ -21,7 +21,7 @@
def setUpClass(cls):
# Loads the asdl module dynamically, since it's not in a real importable
# package.
- # Parses Python.asdl into a ast.Module and run the check on it.
+ # Parses Python.asdl into an ast.Module and run the check on it.
# There's no need to do this for each test method, hence setUpClass.
sys.path.insert(0, parser_dir)
loader = importlib.machinery.SourceFileLoader(
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -2483,7 +2483,7 @@
- Issue #20170: Convert posixmodule to use Argument Clinic.
-- Issue #21539: Add a *exists_ok* argument to `Pathlib.mkdir()` to mimic
+- Issue #21539: Add an *exists_ok* argument to `Pathlib.mkdir()` to mimic
`mkdir -p` and `os.makedirs()` functionality. When true, ignore
FileExistsErrors. Patch by Berker Peksag.
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -3273,7 +3273,7 @@
ssl = SSL_get_app_data(s);
assert(PySSLSocket_Check(ssl));
- /* The servername callback expects a argument that represents the current
+ /* The servername callback expects an argument that represents the current
* SSL connection and that has a .context attribute that can be changed to
* identify the requested hostname. Since the official API is the Python
* level API we want to pass the callback a Python level object rather than
--
Repository URL: https://hg.python.org/cpython
1
0
Nov. 2, 2015
https://hg.python.org/cpython/rev/e8f3c011e2b4
changeset: 98940:e8f3c011e2b4
branch: 2.7
parent: 98905:4ed175ee3cca
user: Serhiy Storchaka <storchaka(a)gmail.com>
date: Mon Nov 02 15:06:09 2015 +0200
summary:
Issue #25523: Backported a-to-an corrections.
files:
Doc/distutils/packageindex.rst | 2 +-
Doc/howto/descriptor.rst | 2 +-
Doc/install/index.rst | 2 +-
Doc/library/email.parser.rst | 2 +-
Doc/library/unittest.rst | 2 +-
Doc/library/zlib.rst | 2 +-
Doc/whatsnew/2.7.rst | 2 +-
Include/unicodeobject.h | 2 +-
Lib/cookielib.py | 2 +-
Lib/ctypes/test/test_random_things.py | 2 +-
Lib/lib-tk/Tkinter.py | 2 +-
Lib/lib2to3/fixes/fix_metaclass.py | 2 +-
Lib/test/regrtest.py | 2 +-
Lib/test/test_dict.py | 2 +-
Lib/test/test_io.py | 2 +-
Lib/test/test_userdict.py | 2 +-
Misc/HISTORY | 2 +-
Misc/NEWS | 2 +-
Modules/_ssl.c | 2 +-
Modules/itertoolsmodule.c | 2 +-
20 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/Doc/distutils/packageindex.rst b/Doc/distutils/packageindex.rst
--- a/Doc/distutils/packageindex.rst
+++ b/Doc/distutils/packageindex.rst
@@ -169,7 +169,7 @@
username: <username>
password: <password>
-The *distutils* section defines a *index-servers* variable that lists the
+The *distutils* section defines an *index-servers* variable that lists the
name of all sections describing a repository.
Each section describing a repository defines three variables:
diff --git a/Doc/howto/descriptor.rst b/Doc/howto/descriptor.rst
--- a/Doc/howto/descriptor.rst
+++ b/Doc/howto/descriptor.rst
@@ -325,7 +325,7 @@
patterns of binding functions into methods.
To recap, functions have a :meth:`__get__` method so that they can be converted
-to a method when accessed as attributes. The non-data descriptor transforms a
+to a method when accessed as attributes. The non-data descriptor transforms an
``obj.f(*args)`` call into ``f(obj, *args)``. Calling ``klass.f(*args)``
becomes ``f(*args)``.
diff --git a/Doc/install/index.rst b/Doc/install/index.rst
--- a/Doc/install/index.rst
+++ b/Doc/install/index.rst
@@ -149,7 +149,7 @@
On Windows, you'd probably download :file:`foo-1.0.zip`. If you downloaded the
archive file to :file:`C:\\Temp`, then it would unpack into
-:file:`C:\\Temp\\foo-1.0`; you can use either a archive manipulator with a
+:file:`C:\\Temp\\foo-1.0`; you can use either an archive manipulator with a
graphical user interface (such as WinZip) or a command-line tool (such as
:program:`unzip` or :program:`pkunzip`) to unpack the archive. Then, open a
command prompt window and run::
diff --git a/Doc/library/email.parser.rst b/Doc/library/email.parser.rst
--- a/Doc/library/email.parser.rst
+++ b/Doc/library/email.parser.rst
@@ -133,7 +133,7 @@
methods on file-like objects.
The text contained in *fp* must be formatted as a block of :rfc:`2822`
- style headers and header continuation lines, optionally preceded by a
+ style headers and header continuation lines, optionally preceded by an
envelope header. The header block is terminated either by the end of the
data or by a blank line. Following the header block is the body of the
message (which may contain MIME-encoded subparts).
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -568,7 +568,7 @@
.. versionadded:: 2.7
Unittest supports skipping individual test methods and even whole classes of
-tests. In addition, it supports marking a test as a "expected failure," a test
+tests. In addition, it supports marking a test as an "expected failure," a test
that is broken and will fail, but shouldn't be counted as a failure on a
:class:`TestResult`.
diff --git a/Doc/library/zlib.rst b/Doc/library/zlib.rst
--- a/Doc/library/zlib.rst
+++ b/Doc/library/zlib.rst
@@ -31,7 +31,7 @@
.. function:: adler32(data[, value])
- Computes a Adler-32 checksum of *data*. (An Adler-32 checksum is almost as
+ Computes an Adler-32 checksum of *data*. (An Adler-32 checksum is almost as
reliable as a CRC32 but can be computed much more quickly.) If *value* is
present, it is used as the starting value of the checksum; otherwise, a fixed
default value is used. This allows computing a running checksum over the
diff --git a/Doc/whatsnew/2.7.rst b/Doc/whatsnew/2.7.rst
--- a/Doc/whatsnew/2.7.rst
+++ b/Doc/whatsnew/2.7.rst
@@ -1118,7 +1118,7 @@
(Fixed by Daniel Stutzbach; :issue:`8729`.)
* Constructors for the parsing classes in the :mod:`ConfigParser` module now
- take a *allow_no_value* parameter, defaulting to false; if true,
+ take an *allow_no_value* parameter, defaulting to false; if true,
options without values will be allowed. For example::
>>> import ConfigParser, StringIO
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -1307,7 +1307,7 @@
int op /* Operation: Py_EQ, Py_NE, Py_GT, etc. */
);
-/* Apply a argument tuple or dictionary to a format string and return
+/* Apply an argument tuple or dictionary to a format string and return
the resulting Unicode string. */
PyAPI_FUNC(PyObject *) PyUnicode_Format(
diff --git a/Lib/cookielib.py b/Lib/cookielib.py
--- a/Lib/cookielib.py
+++ b/Lib/cookielib.py
@@ -1434,7 +1434,7 @@
break
# convert RFC 2965 Max-Age to seconds since epoch
# XXX Strictly you're supposed to follow RFC 2616
- # age-calculation rules. Remember that zero Max-Age is a
+ # age-calculation rules. Remember that zero Max-Age
# is a request to discard (old and new) cookie, though.
k = "expires"
v = self._now + v
diff --git a/Lib/ctypes/test/test_random_things.py b/Lib/ctypes/test/test_random_things.py
--- a/Lib/ctypes/test/test_random_things.py
+++ b/Lib/ctypes/test/test_random_things.py
@@ -30,7 +30,7 @@
# value is printed correctly.
#
# Changed in 0.9.3: No longer is '(in callback)' prepended to the
- # error message - instead a additional frame for the C code is
+ # error message - instead an additional frame for the C code is
# created, then a full traceback printed. When SystemExit is
# raised in a callback function, the interpreter exits.
diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py
--- a/Lib/lib-tk/Tkinter.py
+++ b/Lib/lib-tk/Tkinter.py
@@ -1117,7 +1117,7 @@
return self._bind(('bind', className), sequence, func, add, 0)
def unbind_class(self, className, sequence):
- """Unbind for a all widgets with bindtag CLASSNAME for event SEQUENCE
+ """Unbind for all widgets with bindtag CLASSNAME for event SEQUENCE
all functions."""
self.tk.call('bind', className , sequence, '')
def mainloop(self, n=0):
diff --git a/Lib/lib2to3/fixes/fix_metaclass.py b/Lib/lib2to3/fixes/fix_metaclass.py
--- a/Lib/lib2to3/fixes/fix_metaclass.py
+++ b/Lib/lib2to3/fixes/fix_metaclass.py
@@ -114,7 +114,7 @@
left_node = expr_node.children[0]
if isinstance(left_node, Leaf) and \
left_node.value == u'__metaclass__':
- # We found a assignment to __metaclass__.
+ # We found an assignment to __metaclass__.
fixup_simple_stmt(node, i, simple_node)
remove_trailing_newline(simple_node)
yield (node, i, simple_node)
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -62,7 +62,7 @@
Additional Option Details:
--r randomizes test execution order. You can use --randseed=int to provide a
+-r randomizes test execution order. You can use --randseed=int to provide an
int seed value for the randomizer; this is useful for reproducing troublesome
test orders.
diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py
--- a/Lib/test/test_dict.py
+++ b/Lib/test/test_dict.py
@@ -448,7 +448,7 @@
# (D) subclass defines __missing__ method returning a value
# (E) subclass defines __missing__ method raising RuntimeError
# (F) subclass sets __missing__ instance variable (no effect)
- # (G) subclass doesn't define __missing__ at a all
+ # (G) subclass doesn't define __missing__ at all
class D(dict):
def __missing__(self, key):
return 42
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -15,7 +15,7 @@
################################################################################
# When writing tests for io, it's important to test both the C and Python
# implementations. This is usually done by writing a base test that refers to
-# the type it is testing as a attribute. Then it provides custom subclasses to
+# the type it is testing as an attribute. Then it provides custom subclasses to
# test both implementations. This file has lots of examples.
################################################################################
diff --git a/Lib/test/test_userdict.py b/Lib/test/test_userdict.py
--- a/Lib/test/test_userdict.py
+++ b/Lib/test/test_userdict.py
@@ -188,7 +188,7 @@
# (D) subclass defines __missing__ method returning a value
# (E) subclass defines __missing__ method raising RuntimeError
# (F) subclass sets __missing__ instance variable (no effect)
- # (G) subclass doesn't define __missing__ at a all
+ # (G) subclass doesn't define __missing__ at all
class D(UserDict.UserDict):
def __missing__(self, key):
return 42
diff --git a/Misc/HISTORY b/Misc/HISTORY
--- a/Misc/HISTORY
+++ b/Misc/HISTORY
@@ -1495,7 +1495,7 @@
- Bug #1194181: bz2.BZ2File didn't handle mode 'U' correctly.
-- Patch #1212117: os.stat().st_flags is now accessible as a attribute
+- Patch #1212117: os.stat().st_flags is now accessible as an attribute
if available on the platform.
- Patch #1103951: Expose O_SHLOCK and O_EXLOCK in the posix module if
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -936,7 +936,7 @@
Changes are written to HOME/.idlerc/config-extensions.cfg.
Original patch by Tal Einat.
-- Issue #16233: A module browser (File : Class Browser, Alt+C) requires a
+- Issue #16233: A module browser (File : Class Browser, Alt+C) requires an
editor window with a filename. When Class Browser is requested otherwise,
from a shell, output window, or 'Untitled' editor, Idle no longer displays
an error box. It now pops up an Open Module box (Alt+M). If a valid name
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -2788,7 +2788,7 @@
cadata_ascii = PyUnicode_AsASCIIString(cadata);
if (cadata_ascii == NULL) {
PyErr_SetString(PyExc_TypeError,
- "cadata should be a ASCII string or a "
+ "cadata should be an ASCII string or a "
"bytes-like object");
goto error;
}
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -1410,7 +1410,7 @@
"starmap(function, sequence) --> starmap object\n\
\n\
Return an iterator whose values are returned from the function evaluated\n\
-with a argument tuple taken from the given sequence.");
+with an argument tuple taken from the given sequence.");
static PyTypeObject starmap_type = {
PyVarObject_HEAD_INIT(NULL, 0)
--
Repository URL: https://hg.python.org/cpython
1
0
cpython (merge 3.5 -> default): Issue #25523: Merge a-to-an corrections from 3.5.
by serhiy.storchaka Nov. 2, 2015
by serhiy.storchaka Nov. 2, 2015
Nov. 2, 2015
https://hg.python.org/cpython/rev/72cca30f4707
changeset: 98939:72cca30f4707
parent: 98935:ef4b50e333a5
parent: 98938:a0d0f968b020
user: Serhiy Storchaka <storchaka(a)gmail.com>
date: Mon Nov 02 14:44:29 2015 +0200
summary:
Issue #25523: Merge a-to-an corrections from 3.5.
files:
Doc/distutils/packageindex.rst | 2 +-
Doc/howto/descriptor.rst | 2 +-
Doc/install/index.rst | 2 +-
Doc/library/asyncio-protocol.rst | 2 +-
Doc/library/contextlib.rst | 2 +-
Doc/library/email.parser.rst | 4 ++--
Doc/library/glob.rst | 2 +-
Doc/library/gzip.rst | 2 +-
Doc/library/pickle.rst | 4 ++--
Doc/library/socket.rst | 4 ++--
Doc/library/tokenize.rst | 2 +-
Doc/library/unittest.rst | 2 +-
Doc/library/urllib.request.rst | 2 +-
Doc/library/xml.dom.minidom.rst | 2 +-
Doc/library/zlib.rst | 2 +-
Doc/whatsnew/2.7.rst | 2 +-
Doc/whatsnew/3.3.rst | 2 +-
Include/unicodeobject.h | 4 ++--
Lib/asyncio/sslproto.py | 2 +-
Lib/asyncio/transports.py | 2 +-
Lib/ctypes/test/test_random_things.py | 2 +-
Lib/http/cookiejar.py | 2 +-
Lib/lib2to3/fixes/fix_metaclass.py | 2 +-
Lib/msilib/schema.py | 2 +-
Lib/test/libregrtest/cmdline.py | 2 +-
Lib/test/test_asdl_parser.py | 2 +-
Lib/test/test_dict.py | 2 +-
Lib/test/test_io.py | 2 +-
Lib/test/test_socket.py | 2 +-
Lib/test/test_userdict.py | 2 +-
Lib/tkinter/__init__.py | 2 +-
Misc/HISTORY | 2 +-
Misc/NEWS | 4 ++--
Modules/_ssl.c | 4 ++--
Modules/itertoolsmodule.c | 2 +-
Objects/unicodeobject.c | 4 ++--
36 files changed, 43 insertions(+), 43 deletions(-)
diff --git a/Doc/distutils/packageindex.rst b/Doc/distutils/packageindex.rst
--- a/Doc/distutils/packageindex.rst
+++ b/Doc/distutils/packageindex.rst
@@ -167,7 +167,7 @@
username: <username>
password: <password>
-The *distutils* section defines a *index-servers* variable that lists the
+The *distutils* section defines an *index-servers* variable that lists the
name of all sections describing a repository.
Each section describing a repository defines three variables:
diff --git a/Doc/howto/descriptor.rst b/Doc/howto/descriptor.rst
--- a/Doc/howto/descriptor.rst
+++ b/Doc/howto/descriptor.rst
@@ -319,7 +319,7 @@
patterns of binding functions into methods.
To recap, functions have a :meth:`__get__` method so that they can be converted
-to a method when accessed as attributes. The non-data descriptor transforms a
+to a method when accessed as attributes. The non-data descriptor transforms an
``obj.f(*args)`` call into ``f(obj, *args)``. Calling ``klass.f(*args)``
becomes ``f(*args)``.
diff --git a/Doc/install/index.rst b/Doc/install/index.rst
--- a/Doc/install/index.rst
+++ b/Doc/install/index.rst
@@ -148,7 +148,7 @@
On Windows, you'd probably download :file:`foo-1.0.zip`. If you downloaded the
archive file to :file:`C:\\Temp`, then it would unpack into
-:file:`C:\\Temp\\foo-1.0`; you can use either a archive manipulator with a
+:file:`C:\\Temp\\foo-1.0`; you can use either an archive manipulator with a
graphical user interface (such as WinZip) or a command-line tool (such as
:program:`unzip` or :program:`pkunzip`) to unpack the archive. Then, open a
command prompt window and run::
diff --git a/Doc/library/asyncio-protocol.rst b/Doc/library/asyncio-protocol.rst
--- a/Doc/library/asyncio-protocol.rst
+++ b/Doc/library/asyncio-protocol.rst
@@ -148,7 +148,7 @@
high-water limit. Neither *high* nor *low* can be negative.
The defaults are implementation-specific. If only the
- high-water limit is given, the low-water limit defaults to a
+ high-water limit is given, the low-water limit defaults to an
implementation-specific value less than or equal to the
high-water limit. Setting *high* to zero forces *low* to zero as
well, and causes :meth:`pause_writing` to be called whenever the
diff --git a/Doc/library/contextlib.rst b/Doc/library/contextlib.rst
--- a/Doc/library/contextlib.rst
+++ b/Doc/library/contextlib.rst
@@ -142,7 +142,7 @@
is hardwired to stdout.
For example, the output of :func:`help` normally is sent to *sys.stdout*.
- You can capture that output in a string by redirecting the output to a
+ You can capture that output in a string by redirecting the output to an
:class:`io.StringIO` object::
f = io.StringIO()
diff --git a/Doc/library/email.parser.rst b/Doc/library/email.parser.rst
--- a/Doc/library/email.parser.rst
+++ b/Doc/library/email.parser.rst
@@ -146,7 +146,7 @@
methods on file-like objects.
The text contained in *fp* must be formatted as a block of :rfc:`2822`
- style headers and header continuation lines, optionally preceded by a
+ style headers and header continuation lines, optionally preceded by an
envelope header. The header block is terminated either by the end of the
data or by a blank line. Following the header block is the body of the
message (which may contain MIME-encoded subparts).
@@ -189,7 +189,7 @@
methods on file-like objects.
The bytes contained in *fp* must be formatted as a block of :rfc:`2822`
- style headers and header continuation lines, optionally preceded by a
+ style headers and header continuation lines, optionally preceded by an
envelope header. The header block is terminated either by the end of the
data or by a blank line. Following the header block is the body of the
message (which may contain MIME-encoded subparts, including subparts
diff --git a/Doc/library/glob.rst b/Doc/library/glob.rst
--- a/Doc/library/glob.rst
+++ b/Doc/library/glob.rst
@@ -38,7 +38,7 @@
symlinks are included in the results (as in the shell).
If *recursive* is true, the pattern "``**``" will match any files and zero or
- more directories and subdirectories. If the pattern is followed by a
+ more directories and subdirectories. If the pattern is followed by an
``os.sep``, only directories and subdirectories match.
.. note::
diff --git a/Doc/library/gzip.rst b/Doc/library/gzip.rst
--- a/Doc/library/gzip.rst
+++ b/Doc/library/gzip.rst
@@ -64,7 +64,7 @@
method. At least one of *fileobj* and *filename* must be given a non-trivial
value.
- The new class instance is based on *fileobj*, which can be a regular file, a
+ The new class instance is based on *fileobj*, which can be a regular file, an
:class:`io.BytesIO` object, or any other object which simulates a file. It
defaults to ``None``, in which case *filename* is opened to provide a file
object.
diff --git a/Doc/library/pickle.rst b/Doc/library/pickle.rst
--- a/Doc/library/pickle.rst
+++ b/Doc/library/pickle.rst
@@ -192,7 +192,7 @@
number is specified, :data:`HIGHEST_PROTOCOL` is selected.
The *file* argument must have a write() method that accepts a single bytes
- argument. It can thus be an on-disk file opened for binary writing, a
+ argument. It can thus be an on-disk file opened for binary writing, an
:class:`io.BytesIO` instance, or any other custom object that meets this
interface.
@@ -288,7 +288,7 @@
number is specified, :data:`HIGHEST_PROTOCOL` is selected.
The *file* argument must have a write() method that accepts a single bytes
- argument. It can thus be an on-disk file opened for binary writing, a
+ argument. It can thus be an on-disk file opened for binary writing, an
:class:`io.BytesIO` instance, or any other custom object that meets this
interface.
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -786,7 +786,7 @@
.. function:: sethostname(name)
- Set the machine's hostname to *name*. This will raise a
+ Set the machine's hostname to *name*. This will raise an
:exc:`OSError` if you don't have enough rights.
Availability: Unix.
@@ -818,7 +818,7 @@
.. function:: if_indextoname(if_index)
- Return a network interface name corresponding to a
+ Return a network interface name corresponding to an
interface index number.
:exc:`OSError` if no interface with the given index exists.
diff --git a/Doc/library/tokenize.rst b/Doc/library/tokenize.rst
--- a/Doc/library/tokenize.rst
+++ b/Doc/library/tokenize.rst
@@ -41,7 +41,7 @@
returned as a :term:`named tuple` with the field names:
``type string start end line``.
- The returned :term:`named tuple` has a additional property named
+ The returned :term:`named tuple` has an additional property named
``exact_type`` that contains the exact operator type for
:data:`token.OP` tokens. For all other token types ``exact_type``
equals the named tuple ``type`` field.
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -471,7 +471,7 @@
.. versionadded:: 3.1
Unittest supports skipping individual test methods and even whole classes of
-tests. In addition, it supports marking a test as a "expected failure," a test
+tests. In addition, it supports marking a test as an "expected failure," a test
that is broken and will fail, but shouldn't be counted as a failure on a
:class:`TestResult`.
diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst
--- a/Doc/library/urllib.request.rst
+++ b/Doc/library/urllib.request.rst
@@ -1383,7 +1383,7 @@
.. method:: retrieve(url, filename=None, reporthook=None, data=None)
Retrieves the contents of *url* and places it in *filename*. The return value
- is a tuple consisting of a local filename and either a
+ is a tuple consisting of a local filename and either an
:class:`email.message.Message` object containing the response headers (for remote
URLs) or ``None`` (for local URLs). The caller must then open and read the
contents of *filename*. If *filename* is not given and the URL refers to a
diff --git a/Doc/library/xml.dom.minidom.rst b/Doc/library/xml.dom.minidom.rst
--- a/Doc/library/xml.dom.minidom.rst
+++ b/Doc/library/xml.dom.minidom.rst
@@ -54,7 +54,7 @@
.. function:: parseString(string, parser=None)
- Return a :class:`Document` that represents the *string*. This method creates a
+ Return a :class:`Document` that represents the *string*. This method creates an
:class:`io.StringIO` object for the string and passes that on to :func:`parse`.
Both functions return a :class:`Document` object representing the content of the
diff --git a/Doc/library/zlib.rst b/Doc/library/zlib.rst
--- a/Doc/library/zlib.rst
+++ b/Doc/library/zlib.rst
@@ -30,7 +30,7 @@
.. function:: adler32(data[, value])
- Computes a Adler-32 checksum of *data*. (An Adler-32 checksum is almost as
+ Computes an Adler-32 checksum of *data*. (An Adler-32 checksum is almost as
reliable as a CRC32 but can be computed much more quickly.) If *value* is
present, it is used as the starting value of the checksum; otherwise, a fixed
default value is used. This allows computing a running checksum over the
diff --git a/Doc/whatsnew/2.7.rst b/Doc/whatsnew/2.7.rst
--- a/Doc/whatsnew/2.7.rst
+++ b/Doc/whatsnew/2.7.rst
@@ -1118,7 +1118,7 @@
(Fixed by Daniel Stutzbach; :issue:`8729`.)
* Constructors for the parsing classes in the :mod:`ConfigParser` module now
- take a *allow_no_value* parameter, defaulting to false; if true,
+ take an *allow_no_value* parameter, defaulting to false; if true,
options without values will be allowed. For example::
>>> import ConfigParser, StringIO
diff --git a/Doc/whatsnew/3.3.rst b/Doc/whatsnew/3.3.rst
--- a/Doc/whatsnew/3.3.rst
+++ b/Doc/whatsnew/3.3.rst
@@ -2155,7 +2155,7 @@
* encode an ASCII string to UTF-8 doesn't need to encode characters anymore,
the UTF-8 representation is shared with the ASCII representation
* the UTF-8 encoder has been optimized
- * repeating a single ASCII letter and getting a substring of a ASCII strings
+ * repeating a single ASCII letter and getting a substring of an ASCII string
is 4 times faster
* UTF-8 is now 2x to 4x faster. UTF-16 encoding is now up to 10x faster.
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -982,7 +982,7 @@
Py_ssize_t end
);
-/* Append a ASCII-encoded byte string.
+/* Append an ASCII-encoded byte string.
Return 0 on success, raise an exception and return -1 on error. */
PyAPI_FUNC(int)
_PyUnicodeWriter_WriteASCIIString(_PyUnicodeWriter *writer,
@@ -2058,7 +2058,7 @@
int op /* Operation: Py_EQ, Py_NE, Py_GT, etc. */
);
-/* Apply a argument tuple or dictionary to a format string and return
+/* Apply an argument tuple or dictionary to a format string and return
the resulting Unicode string. */
PyAPI_FUNC(PyObject *) PyUnicode_Format(
diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py
--- a/Lib/asyncio/sslproto.py
+++ b/Lib/asyncio/sslproto.py
@@ -349,7 +349,7 @@
high-water limit. Neither value can be negative.
The defaults are implementation-specific. If only the
- high-water limit is given, the low-water limit defaults to a
+ high-water limit is given, the low-water limit defaults to an
implementation-specific value less than or equal to the
high-water limit. Setting high to zero forces low to zero as
well, and causes pause_writing() to be called whenever the
diff --git a/Lib/asyncio/transports.py b/Lib/asyncio/transports.py
--- a/Lib/asyncio/transports.py
+++ b/Lib/asyncio/transports.py
@@ -62,7 +62,7 @@
high-water limit. Neither value can be negative.
The defaults are implementation-specific. If only the
- high-water limit is given, the low-water limit defaults to a
+ high-water limit is given, the low-water limit defaults to an
implementation-specific value less than or equal to the
high-water limit. Setting high to zero forces low to zero as
well, and causes pause_writing() to be called whenever the
diff --git a/Lib/ctypes/test/test_random_things.py b/Lib/ctypes/test/test_random_things.py
--- a/Lib/ctypes/test/test_random_things.py
+++ b/Lib/ctypes/test/test_random_things.py
@@ -30,7 +30,7 @@
# value is printed correctly.
#
# Changed in 0.9.3: No longer is '(in callback)' prepended to the
- # error message - instead a additional frame for the C code is
+ # error message - instead an additional frame for the C code is
# created, then a full traceback printed. When SystemExit is
# raised in a callback function, the interpreter exits.
diff --git a/Lib/http/cookiejar.py b/Lib/http/cookiejar.py
--- a/Lib/http/cookiejar.py
+++ b/Lib/http/cookiejar.py
@@ -1437,7 +1437,7 @@
break
# convert RFC 2965 Max-Age to seconds since epoch
# XXX Strictly you're supposed to follow RFC 2616
- # age-calculation rules. Remember that zero Max-Age is a
+ # age-calculation rules. Remember that zero Max-Age
# is a request to discard (old and new) cookie, though.
k = "expires"
v = self._now + v
diff --git a/Lib/lib2to3/fixes/fix_metaclass.py b/Lib/lib2to3/fixes/fix_metaclass.py
--- a/Lib/lib2to3/fixes/fix_metaclass.py
+++ b/Lib/lib2to3/fixes/fix_metaclass.py
@@ -114,7 +114,7 @@
left_node = expr_node.children[0]
if isinstance(left_node, Leaf) and \
left_node.value == '__metaclass__':
- # We found a assignment to __metaclass__.
+ # We found an assignment to __metaclass__.
fixup_simple_stmt(node, i, simple_node)
remove_trailing_newline(simple_node)
yield (node, i, simple_node)
diff --git a/Lib/msilib/schema.py b/Lib/msilib/schema.py
--- a/Lib/msilib/schema.py
+++ b/Lib/msilib/schema.py
@@ -733,7 +733,7 @@
('CustomAction','Source','Y',None, None, None, None, 'CustomSource',None, 'The table reference of the source of the code.',),
('CustomAction','Target','Y',None, None, None, None, 'Formatted',None, 'Excecution parameter, depends on the type of custom action',),
('DrLocator','Signature_','N',None, None, None, None, 'Identifier',None, 'The Signature_ represents a unique file signature and is also the foreign key in the Signature table.',),
-('DrLocator','Path','Y',None, None, None, None, 'AnyPath',None, 'The path on the user system. This is a either a subpath below the value of the Parent or a full path. The path may contain properties enclosed within [ ] that will be expanded.',),
+('DrLocator','Path','Y',None, None, None, None, 'AnyPath',None, 'The path on the user system. This is either a subpath below the value of the Parent or a full path. The path may contain properties enclosed within [ ] that will be expanded.',),
('DrLocator','Depth','Y',0,32767,None, None, None, None, 'The depth below the path to which the Signature_ is recursively searched. If absent, the depth is assumed to be 0.',),
('DrLocator','Parent','Y',None, None, None, None, 'Identifier',None, 'The parent file signature. It is also a foreign key in the Signature table. If null and the Path column does not expand to a full path, then all the fixed drives of the user system are searched using the Path.',),
('DuplicateFile','File_','N',None, None, 'File',1,'Identifier',None, 'Foreign key referencing the source file to be duplicated.',),
diff --git a/Lib/test/libregrtest/cmdline.py b/Lib/test/libregrtest/cmdline.py
--- a/Lib/test/libregrtest/cmdline.py
+++ b/Lib/test/libregrtest/cmdline.py
@@ -25,7 +25,7 @@
EPILOG = """\
Additional option details:
--r randomizes test execution order. You can use --randseed=int to provide a
+-r randomizes test execution order. You can use --randseed=int to provide an
int seed value for the randomizer; this is useful for reproducing troublesome
test orders.
diff --git a/Lib/test/test_asdl_parser.py b/Lib/test/test_asdl_parser.py
--- a/Lib/test/test_asdl_parser.py
+++ b/Lib/test/test_asdl_parser.py
@@ -21,7 +21,7 @@
def setUpClass(cls):
# Loads the asdl module dynamically, since it's not in a real importable
# package.
- # Parses Python.asdl into a ast.Module and run the check on it.
+ # Parses Python.asdl into an ast.Module and run the check on it.
# There's no need to do this for each test method, hence setUpClass.
sys.path.insert(0, parser_dir)
loader = importlib.machinery.SourceFileLoader(
diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py
--- a/Lib/test/test_dict.py
+++ b/Lib/test/test_dict.py
@@ -603,7 +603,7 @@
# (D) subclass defines __missing__ method returning a value
# (E) subclass defines __missing__ method raising RuntimeError
# (F) subclass sets __missing__ instance variable (no effect)
- # (G) subclass doesn't define __missing__ at a all
+ # (G) subclass doesn't define __missing__ at all
class D(dict):
def __missing__(self, key):
return 42
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -15,7 +15,7 @@
################################################################################
# When writing tests for io, it's important to test both the C and Python
# implementations. This is usually done by writing a base test that refers to
-# the type it is testing as a attribute. Then it provides custom subclasses to
+# the type it is testing as an attribute. Then it provides custom subclasses to
# test both implementations. This file has lots of examples.
################################################################################
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -4549,7 +4549,7 @@
except OSError as e:
if str(e) == "AF_UNIX path too long":
self.skipTest(
- "Pathname {0!a} is too long to serve as a AF_UNIX path"
+ "Pathname {0!a} is too long to serve as an AF_UNIX path"
.format(path))
else:
raise
diff --git a/Lib/test/test_userdict.py b/Lib/test/test_userdict.py
--- a/Lib/test/test_userdict.py
+++ b/Lib/test/test_userdict.py
@@ -171,7 +171,7 @@
# (D) subclass defines __missing__ method returning a value
# (E) subclass defines __missing__ method raising RuntimeError
# (F) subclass sets __missing__ instance variable (no effect)
- # (G) subclass doesn't define __missing__ at a all
+ # (G) subclass doesn't define __missing__ at all
class D(collections.UserDict):
def __missing__(self, key):
return 42
diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py
--- a/Lib/tkinter/__init__.py
+++ b/Lib/tkinter/__init__.py
@@ -1123,7 +1123,7 @@
return self._bind(('bind', className), sequence, func, add, 0)
def unbind_class(self, className, sequence):
- """Unbind for a all widgets with bindtag CLASSNAME for event SEQUENCE
+ """Unbind for all widgets with bindtag CLASSNAME for event SEQUENCE
all functions."""
self.tk.call('bind', className , sequence, '')
def mainloop(self, n=0):
diff --git a/Misc/HISTORY b/Misc/HISTORY
--- a/Misc/HISTORY
+++ b/Misc/HISTORY
@@ -12412,7 +12412,7 @@
- Bug #1194181: bz2.BZ2File didn't handle mode 'U' correctly.
-- Patch #1212117: os.stat().st_flags is now accessible as a attribute
+- Patch #1212117: os.stat().st_flags is now accessible as an attribute
if available on the platform.
- Patch #1103951: Expose O_SHLOCK and O_EXLOCK in the posix module if
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -2651,7 +2651,7 @@
- Issue #20170: Convert posixmodule to use Argument Clinic.
-- Issue #21539: Add a *exists_ok* argument to `Pathlib.mkdir()` to mimic
+- Issue #21539: Add an *exists_ok* argument to `Pathlib.mkdir()` to mimic
`mkdir -p` and `os.makedirs()` functionality. When true, ignore
FileExistsErrors. Patch by Berker Peksag.
@@ -3240,7 +3240,7 @@
Changes are written to HOME/.idlerc/config-extensions.cfg.
Original patch by Tal Einat.
-- Issue #16233: A module browser (File : Class Browser, Alt+C) requires a
+- Issue #16233: A module browser (File : Class Browser, Alt+C) requires an
editor window with a filename. When Class Browser is requested otherwise,
from a shell, output window, or 'Untitled' editor, Idle no longer displays
an error box. It now pops up an Open Module box (Alt+M). If a valid name
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -2996,7 +2996,7 @@
cadata_ascii = PyUnicode_AsASCIIString(cadata);
if (cadata_ascii == NULL) {
PyErr_SetString(PyExc_TypeError,
- "cadata should be a ASCII string or a "
+ "cadata should be an ASCII string or a "
"bytes-like object");
goto error;
}
@@ -3273,7 +3273,7 @@
ssl = SSL_get_app_data(s);
assert(PySSLSocket_Check(ssl));
- /* The servername callback expects a argument that represents the current
+ /* The servername callback expects an argument that represents the current
* SSL connection and that has a .context attribute that can be changed to
* identify the requested hostname. Since the official API is the Python
* level API we want to pass the callback a Python level object rather than
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -1743,7 +1743,7 @@
"starmap(function, sequence) --> starmap object\n\
\n\
Return an iterator whose values are returned from the function evaluated\n\
-with a argument tuple taken from the given sequence.");
+with an argument tuple taken from the given sequence.");
static PyTypeObject starmap_type = {
PyVarObject_HEAD_INIT(NULL, 0)
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -1865,7 +1865,7 @@
return unicode_resize(p_unicode, length);
}
-/* Copy a ASCII or latin1 char* string into a Python Unicode string.
+/* Copy an ASCII or latin1 char* string into a Python Unicode string.
WARNING: The function doesn't copy the terminating null character and
doesn't check the maximum character (may write a latin1 character in an
@@ -7411,7 +7411,7 @@
}
/*
- * Encode a Unicode string to a Windows code page into a byte string using a
+ * Encode a Unicode string to a Windows code page into a byte string using an
* error handler.
*
* Returns consumed characters if succeed, or raise an OSError and returns
--
Repository URL: https://hg.python.org/cpython
1
0
cpython (merge 3.4 -> 3.5): Issue #25523: Merge a-to-an corrections from 3.4.
by serhiy.storchaka Nov. 2, 2015
by serhiy.storchaka Nov. 2, 2015
Nov. 2, 2015
https://hg.python.org/cpython/rev/68edc7baeef7
changeset: 98937:68edc7baeef7
branch: 3.5
parent: 98930:2347271172b3
parent: 98936:75df8b0a2cd1
user: Serhiy Storchaka <storchaka(a)gmail.com>
date: Mon Nov 02 14:39:05 2015 +0200
summary:
Issue #25523: Merge a-to-an corrections from 3.4.
files:
Doc/distutils/packageindex.rst | 2 +-
Doc/howto/descriptor.rst | 2 +-
Doc/install/index.rst | 2 +-
Doc/library/asyncio-protocol.rst | 2 +-
Doc/library/contextlib.rst | 2 +-
Doc/library/email.parser.rst | 4 ++--
Doc/library/gzip.rst | 2 +-
Doc/library/pickle.rst | 4 ++--
Doc/library/socket.rst | 4 ++--
Doc/library/tokenize.rst | 2 +-
Doc/library/unittest.rst | 2 +-
Doc/library/urllib.request.rst | 2 +-
Doc/library/xml.dom.minidom.rst | 2 +-
Doc/library/zlib.rst | 2 +-
Doc/whatsnew/2.7.rst | 2 +-
Doc/whatsnew/3.3.rst | 2 +-
Include/unicodeobject.h | 4 ++--
Lib/asyncio/sslproto.py | 2 +-
Lib/asyncio/transports.py | 2 +-
Lib/ctypes/test/test_random_things.py | 2 +-
Lib/http/cookiejar.py | 2 +-
Lib/lib2to3/fixes/fix_metaclass.py | 2 +-
Lib/msilib/schema.py | 2 +-
Lib/test/regrtest.py | 2 +-
Lib/test/test_dict.py | 2 +-
Lib/test/test_io.py | 2 +-
Lib/test/test_socket.py | 2 +-
Lib/test/test_userdict.py | 2 +-
Lib/tkinter/__init__.py | 2 +-
Misc/HISTORY | 2 +-
Misc/NEWS | 2 +-
Modules/_ssl.c | 2 +-
Modules/itertoolsmodule.c | 2 +-
Objects/unicodeobject.c | 4 ++--
34 files changed, 39 insertions(+), 39 deletions(-)
diff --git a/Doc/distutils/packageindex.rst b/Doc/distutils/packageindex.rst
--- a/Doc/distutils/packageindex.rst
+++ b/Doc/distutils/packageindex.rst
@@ -167,7 +167,7 @@
username: <username>
password: <password>
-The *distutils* section defines a *index-servers* variable that lists the
+The *distutils* section defines an *index-servers* variable that lists the
name of all sections describing a repository.
Each section describing a repository defines three variables:
diff --git a/Doc/howto/descriptor.rst b/Doc/howto/descriptor.rst
--- a/Doc/howto/descriptor.rst
+++ b/Doc/howto/descriptor.rst
@@ -319,7 +319,7 @@
patterns of binding functions into methods.
To recap, functions have a :meth:`__get__` method so that they can be converted
-to a method when accessed as attributes. The non-data descriptor transforms a
+to a method when accessed as attributes. The non-data descriptor transforms an
``obj.f(*args)`` call into ``f(obj, *args)``. Calling ``klass.f(*args)``
becomes ``f(*args)``.
diff --git a/Doc/install/index.rst b/Doc/install/index.rst
--- a/Doc/install/index.rst
+++ b/Doc/install/index.rst
@@ -148,7 +148,7 @@
On Windows, you'd probably download :file:`foo-1.0.zip`. If you downloaded the
archive file to :file:`C:\\Temp`, then it would unpack into
-:file:`C:\\Temp\\foo-1.0`; you can use either a archive manipulator with a
+:file:`C:\\Temp\\foo-1.0`; you can use either an archive manipulator with a
graphical user interface (such as WinZip) or a command-line tool (such as
:program:`unzip` or :program:`pkunzip`) to unpack the archive. Then, open a
command prompt window and run::
diff --git a/Doc/library/asyncio-protocol.rst b/Doc/library/asyncio-protocol.rst
--- a/Doc/library/asyncio-protocol.rst
+++ b/Doc/library/asyncio-protocol.rst
@@ -148,7 +148,7 @@
high-water limit. Neither *high* nor *low* can be negative.
The defaults are implementation-specific. If only the
- high-water limit is given, the low-water limit defaults to a
+ high-water limit is given, the low-water limit defaults to an
implementation-specific value less than or equal to the
high-water limit. Setting *high* to zero forces *low* to zero as
well, and causes :meth:`pause_writing` to be called whenever the
diff --git a/Doc/library/contextlib.rst b/Doc/library/contextlib.rst
--- a/Doc/library/contextlib.rst
+++ b/Doc/library/contextlib.rst
@@ -142,7 +142,7 @@
is hardwired to stdout.
For example, the output of :func:`help` normally is sent to *sys.stdout*.
- You can capture that output in a string by redirecting the output to a
+ You can capture that output in a string by redirecting the output to an
:class:`io.StringIO` object::
f = io.StringIO()
diff --git a/Doc/library/email.parser.rst b/Doc/library/email.parser.rst
--- a/Doc/library/email.parser.rst
+++ b/Doc/library/email.parser.rst
@@ -146,7 +146,7 @@
methods on file-like objects.
The text contained in *fp* must be formatted as a block of :rfc:`2822`
- style headers and header continuation lines, optionally preceded by a
+ style headers and header continuation lines, optionally preceded by an
envelope header. The header block is terminated either by the end of the
data or by a blank line. Following the header block is the body of the
message (which may contain MIME-encoded subparts).
@@ -189,7 +189,7 @@
methods on file-like objects.
The bytes contained in *fp* must be formatted as a block of :rfc:`2822`
- style headers and header continuation lines, optionally preceded by a
+ style headers and header continuation lines, optionally preceded by an
envelope header. The header block is terminated either by the end of the
data or by a blank line. Following the header block is the body of the
message (which may contain MIME-encoded subparts, including subparts
diff --git a/Doc/library/gzip.rst b/Doc/library/gzip.rst
--- a/Doc/library/gzip.rst
+++ b/Doc/library/gzip.rst
@@ -64,7 +64,7 @@
method. At least one of *fileobj* and *filename* must be given a non-trivial
value.
- The new class instance is based on *fileobj*, which can be a regular file, a
+ The new class instance is based on *fileobj*, which can be a regular file, an
:class:`io.BytesIO` object, or any other object which simulates a file. It
defaults to ``None``, in which case *filename* is opened to provide a file
object.
diff --git a/Doc/library/pickle.rst b/Doc/library/pickle.rst
--- a/Doc/library/pickle.rst
+++ b/Doc/library/pickle.rst
@@ -192,7 +192,7 @@
number is specified, :data:`HIGHEST_PROTOCOL` is selected.
The *file* argument must have a write() method that accepts a single bytes
- argument. It can thus be an on-disk file opened for binary writing, a
+ argument. It can thus be an on-disk file opened for binary writing, an
:class:`io.BytesIO` instance, or any other custom object that meets this
interface.
@@ -288,7 +288,7 @@
number is specified, :data:`HIGHEST_PROTOCOL` is selected.
The *file* argument must have a write() method that accepts a single bytes
- argument. It can thus be an on-disk file opened for binary writing, a
+ argument. It can thus be an on-disk file opened for binary writing, an
:class:`io.BytesIO` instance, or any other custom object that meets this
interface.
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -786,7 +786,7 @@
.. function:: sethostname(name)
- Set the machine's hostname to *name*. This will raise a
+ Set the machine's hostname to *name*. This will raise an
:exc:`OSError` if you don't have enough rights.
Availability: Unix.
@@ -818,7 +818,7 @@
.. function:: if_indextoname(if_index)
- Return a network interface name corresponding to a
+ Return a network interface name corresponding to an
interface index number.
:exc:`OSError` if no interface with the given index exists.
diff --git a/Doc/library/tokenize.rst b/Doc/library/tokenize.rst
--- a/Doc/library/tokenize.rst
+++ b/Doc/library/tokenize.rst
@@ -41,7 +41,7 @@
returned as a :term:`named tuple` with the field names:
``type string start end line``.
- The returned :term:`named tuple` has a additional property named
+ The returned :term:`named tuple` has an additional property named
``exact_type`` that contains the exact operator type for
:data:`token.OP` tokens. For all other token types ``exact_type``
equals the named tuple ``type`` field.
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -471,7 +471,7 @@
.. versionadded:: 3.1
Unittest supports skipping individual test methods and even whole classes of
-tests. In addition, it supports marking a test as a "expected failure," a test
+tests. In addition, it supports marking a test as an "expected failure," a test
that is broken and will fail, but shouldn't be counted as a failure on a
:class:`TestResult`.
diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst
--- a/Doc/library/urllib.request.rst
+++ b/Doc/library/urllib.request.rst
@@ -1383,7 +1383,7 @@
.. method:: retrieve(url, filename=None, reporthook=None, data=None)
Retrieves the contents of *url* and places it in *filename*. The return value
- is a tuple consisting of a local filename and either a
+ is a tuple consisting of a local filename and either an
:class:`email.message.Message` object containing the response headers (for remote
URLs) or ``None`` (for local URLs). The caller must then open and read the
contents of *filename*. If *filename* is not given and the URL refers to a
diff --git a/Doc/library/xml.dom.minidom.rst b/Doc/library/xml.dom.minidom.rst
--- a/Doc/library/xml.dom.minidom.rst
+++ b/Doc/library/xml.dom.minidom.rst
@@ -54,7 +54,7 @@
.. function:: parseString(string, parser=None)
- Return a :class:`Document` that represents the *string*. This method creates a
+ Return a :class:`Document` that represents the *string*. This method creates an
:class:`io.StringIO` object for the string and passes that on to :func:`parse`.
Both functions return a :class:`Document` object representing the content of the
diff --git a/Doc/library/zlib.rst b/Doc/library/zlib.rst
--- a/Doc/library/zlib.rst
+++ b/Doc/library/zlib.rst
@@ -30,7 +30,7 @@
.. function:: adler32(data[, value])
- Computes a Adler-32 checksum of *data*. (An Adler-32 checksum is almost as
+ Computes an Adler-32 checksum of *data*. (An Adler-32 checksum is almost as
reliable as a CRC32 but can be computed much more quickly.) If *value* is
present, it is used as the starting value of the checksum; otherwise, a fixed
default value is used. This allows computing a running checksum over the
diff --git a/Doc/whatsnew/2.7.rst b/Doc/whatsnew/2.7.rst
--- a/Doc/whatsnew/2.7.rst
+++ b/Doc/whatsnew/2.7.rst
@@ -1118,7 +1118,7 @@
(Fixed by Daniel Stutzbach; :issue:`8729`.)
* Constructors for the parsing classes in the :mod:`ConfigParser` module now
- take a *allow_no_value* parameter, defaulting to false; if true,
+ take an *allow_no_value* parameter, defaulting to false; if true,
options without values will be allowed. For example::
>>> import ConfigParser, StringIO
diff --git a/Doc/whatsnew/3.3.rst b/Doc/whatsnew/3.3.rst
--- a/Doc/whatsnew/3.3.rst
+++ b/Doc/whatsnew/3.3.rst
@@ -2155,7 +2155,7 @@
* encode an ASCII string to UTF-8 doesn't need to encode characters anymore,
the UTF-8 representation is shared with the ASCII representation
* the UTF-8 encoder has been optimized
- * repeating a single ASCII letter and getting a substring of a ASCII strings
+ * repeating a single ASCII letter and getting a substring of an ASCII string
is 4 times faster
* UTF-8 is now 2x to 4x faster. UTF-16 encoding is now up to 10x faster.
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -965,7 +965,7 @@
Py_ssize_t end
);
-/* Append a ASCII-encoded byte string.
+/* Append an ASCII-encoded byte string.
Return 0 on success, raise an exception and return -1 on error. */
PyAPI_FUNC(int)
_PyUnicodeWriter_WriteASCIIString(_PyUnicodeWriter *writer,
@@ -2041,7 +2041,7 @@
int op /* Operation: Py_EQ, Py_NE, Py_GT, etc. */
);
-/* Apply a argument tuple or dictionary to a format string and return
+/* Apply an argument tuple or dictionary to a format string and return
the resulting Unicode string. */
PyAPI_FUNC(PyObject *) PyUnicode_Format(
diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py
--- a/Lib/asyncio/sslproto.py
+++ b/Lib/asyncio/sslproto.py
@@ -349,7 +349,7 @@
high-water limit. Neither value can be negative.
The defaults are implementation-specific. If only the
- high-water limit is given, the low-water limit defaults to a
+ high-water limit is given, the low-water limit defaults to an
implementation-specific value less than or equal to the
high-water limit. Setting high to zero forces low to zero as
well, and causes pause_writing() to be called whenever the
diff --git a/Lib/asyncio/transports.py b/Lib/asyncio/transports.py
--- a/Lib/asyncio/transports.py
+++ b/Lib/asyncio/transports.py
@@ -62,7 +62,7 @@
high-water limit. Neither value can be negative.
The defaults are implementation-specific. If only the
- high-water limit is given, the low-water limit defaults to a
+ high-water limit is given, the low-water limit defaults to an
implementation-specific value less than or equal to the
high-water limit. Setting high to zero forces low to zero as
well, and causes pause_writing() to be called whenever the
diff --git a/Lib/ctypes/test/test_random_things.py b/Lib/ctypes/test/test_random_things.py
--- a/Lib/ctypes/test/test_random_things.py
+++ b/Lib/ctypes/test/test_random_things.py
@@ -30,7 +30,7 @@
# value is printed correctly.
#
# Changed in 0.9.3: No longer is '(in callback)' prepended to the
- # error message - instead a additional frame for the C code is
+ # error message - instead an additional frame for the C code is
# created, then a full traceback printed. When SystemExit is
# raised in a callback function, the interpreter exits.
diff --git a/Lib/http/cookiejar.py b/Lib/http/cookiejar.py
--- a/Lib/http/cookiejar.py
+++ b/Lib/http/cookiejar.py
@@ -1437,7 +1437,7 @@
break
# convert RFC 2965 Max-Age to seconds since epoch
# XXX Strictly you're supposed to follow RFC 2616
- # age-calculation rules. Remember that zero Max-Age is a
+ # age-calculation rules. Remember that zero Max-Age
# is a request to discard (old and new) cookie, though.
k = "expires"
v = self._now + v
diff --git a/Lib/lib2to3/fixes/fix_metaclass.py b/Lib/lib2to3/fixes/fix_metaclass.py
--- a/Lib/lib2to3/fixes/fix_metaclass.py
+++ b/Lib/lib2to3/fixes/fix_metaclass.py
@@ -114,7 +114,7 @@
left_node = expr_node.children[0]
if isinstance(left_node, Leaf) and \
left_node.value == '__metaclass__':
- # We found a assignment to __metaclass__.
+ # We found an assignment to __metaclass__.
fixup_simple_stmt(node, i, simple_node)
remove_trailing_newline(simple_node)
yield (node, i, simple_node)
diff --git a/Lib/msilib/schema.py b/Lib/msilib/schema.py
--- a/Lib/msilib/schema.py
+++ b/Lib/msilib/schema.py
@@ -733,7 +733,7 @@
('CustomAction','Source','Y',None, None, None, None, 'CustomSource',None, 'The table reference of the source of the code.',),
('CustomAction','Target','Y',None, None, None, None, 'Formatted',None, 'Excecution parameter, depends on the type of custom action',),
('DrLocator','Signature_','N',None, None, None, None, 'Identifier',None, 'The Signature_ represents a unique file signature and is also the foreign key in the Signature table.',),
-('DrLocator','Path','Y',None, None, None, None, 'AnyPath',None, 'The path on the user system. This is a either a subpath below the value of the Parent or a full path. The path may contain properties enclosed within [ ] that will be expanded.',),
+('DrLocator','Path','Y',None, None, None, None, 'AnyPath',None, 'The path on the user system. This is either a subpath below the value of the Parent or a full path. The path may contain properties enclosed within [ ] that will be expanded.',),
('DrLocator','Depth','Y',0,32767,None, None, None, None, 'The depth below the path to which the Signature_ is recursively searched. If absent, the depth is assumed to be 0.',),
('DrLocator','Parent','Y',None, None, None, None, 'Identifier',None, 'The parent file signature. It is also a foreign key in the Signature table. If null and the Path column does not expand to a full path, then all the fixed drives of the user system are searched using the Path.',),
('DuplicateFile','File_','N',None, None, 'File',1,'Identifier',None, 'Foreign key referencing the source file to be duplicated.',),
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -27,7 +27,7 @@
EPILOG = """\
Additional option details:
--r randomizes test execution order. You can use --randseed=int to provide a
+-r randomizes test execution order. You can use --randseed=int to provide an
int seed value for the randomizer; this is useful for reproducing troublesome
test orders.
diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py
--- a/Lib/test/test_dict.py
+++ b/Lib/test/test_dict.py
@@ -603,7 +603,7 @@
# (D) subclass defines __missing__ method returning a value
# (E) subclass defines __missing__ method raising RuntimeError
# (F) subclass sets __missing__ instance variable (no effect)
- # (G) subclass doesn't define __missing__ at a all
+ # (G) subclass doesn't define __missing__ at all
class D(dict):
def __missing__(self, key):
return 42
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -15,7 +15,7 @@
################################################################################
# When writing tests for io, it's important to test both the C and Python
# implementations. This is usually done by writing a base test that refers to
-# the type it is testing as a attribute. Then it provides custom subclasses to
+# the type it is testing as an attribute. Then it provides custom subclasses to
# test both implementations. This file has lots of examples.
################################################################################
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -4549,7 +4549,7 @@
except OSError as e:
if str(e) == "AF_UNIX path too long":
self.skipTest(
- "Pathname {0!a} is too long to serve as a AF_UNIX path"
+ "Pathname {0!a} is too long to serve as an AF_UNIX path"
.format(path))
else:
raise
diff --git a/Lib/test/test_userdict.py b/Lib/test/test_userdict.py
--- a/Lib/test/test_userdict.py
+++ b/Lib/test/test_userdict.py
@@ -171,7 +171,7 @@
# (D) subclass defines __missing__ method returning a value
# (E) subclass defines __missing__ method raising RuntimeError
# (F) subclass sets __missing__ instance variable (no effect)
- # (G) subclass doesn't define __missing__ at a all
+ # (G) subclass doesn't define __missing__ at all
class D(collections.UserDict):
def __missing__(self, key):
return 42
diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py
--- a/Lib/tkinter/__init__.py
+++ b/Lib/tkinter/__init__.py
@@ -1123,7 +1123,7 @@
return self._bind(('bind', className), sequence, func, add, 0)
def unbind_class(self, className, sequence):
- """Unbind for a all widgets with bindtag CLASSNAME for event SEQUENCE
+ """Unbind for all widgets with bindtag CLASSNAME for event SEQUENCE
all functions."""
self.tk.call('bind', className , sequence, '')
def mainloop(self, n=0):
diff --git a/Misc/HISTORY b/Misc/HISTORY
--- a/Misc/HISTORY
+++ b/Misc/HISTORY
@@ -12412,7 +12412,7 @@
- Bug #1194181: bz2.BZ2File didn't handle mode 'U' correctly.
-- Patch #1212117: os.stat().st_flags is now accessible as a attribute
+- Patch #1212117: os.stat().st_flags is now accessible as an attribute
if available on the platform.
- Patch #1103951: Expose O_SHLOCK and O_EXLOCK in the posix module if
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -3072,7 +3072,7 @@
Changes are written to HOME/.idlerc/config-extensions.cfg.
Original patch by Tal Einat.
-- Issue #16233: A module browser (File : Class Browser, Alt+C) requires a
+- Issue #16233: A module browser (File : Class Browser, Alt+C) requires an
editor window with a filename. When Class Browser is requested otherwise,
from a shell, output window, or 'Untitled' editor, Idle no longer displays
an error box. It now pops up an Open Module box (Alt+M). If a valid name
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -2996,7 +2996,7 @@
cadata_ascii = PyUnicode_AsASCIIString(cadata);
if (cadata_ascii == NULL) {
PyErr_SetString(PyExc_TypeError,
- "cadata should be a ASCII string or a "
+ "cadata should be an ASCII string or a "
"bytes-like object");
goto error;
}
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -1725,7 +1725,7 @@
"starmap(function, sequence) --> starmap object\n\
\n\
Return an iterator whose values are returned from the function evaluated\n\
-with a argument tuple taken from the given sequence.");
+with an argument tuple taken from the given sequence.");
static PyTypeObject starmap_type = {
PyVarObject_HEAD_INIT(NULL, 0)
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -1701,7 +1701,7 @@
return unicode_resize(p_unicode, length);
}
-/* Copy a ASCII or latin1 char* string into a Python Unicode string.
+/* Copy an ASCII or latin1 char* string into a Python Unicode string.
WARNING: The function doesn't copy the terminating null character and
doesn't check the maximum character (may write a latin1 character in an
@@ -7191,7 +7191,7 @@
}
/*
- * Encode a Unicode string to a Windows code page into a byte string using a
+ * Encode a Unicode string to a Windows code page into a byte string using an
* error handler.
*
* Returns consumed characters if succeed, or raise an OSError and returns
--
Repository URL: https://hg.python.org/cpython
1
0
https://hg.python.org/cpython/rev/ef4b50e333a5
changeset: 98935:ef4b50e333a5
user: Raymond Hettinger <python(a)rcn.com>
date: Mon Nov 02 07:27:40 2015 -0500
summary:
Minor cleanup.
files:
Modules/_collectionsmodule.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c
--- a/Modules/_collectionsmodule.c
+++ b/Modules/_collectionsmodule.c
@@ -1060,7 +1060,7 @@
cmp = PyObject_RichCompareBool(item, v, Py_EQ);
if (cmp > 0)
return PyLong_FromSsize_t(stop - (n + 1));
- else if (cmp < 0)
+ if (cmp < 0)
return NULL;
if (start_state != deque->state) {
PyErr_SetString(PyExc_RuntimeError,
--
Repository URL: https://hg.python.org/cpython
1
0
results for 83fa2e9b0038 on branch "default"
--------------------------------------------
test_capi leaked [1, 1, 1] references, sum=3
test_functools leaked [0, 2, 2] memory blocks, sum=4
Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogtO7O39', '--timeout', '7200']
1
0
cpython: Issue #24379: Revert the operator.subscript patch (dccc4e63aef5) pending
by raymond.hettinger Nov. 2, 2015
by raymond.hettinger Nov. 2, 2015
Nov. 2, 2015
https://hg.python.org/cpython/rev/83fa2e9b0038
changeset: 98934:83fa2e9b0038
user: Raymond Hettinger <python(a)rcn.com>
date: Mon Nov 02 00:39:56 2015 -0500
summary:
Issue #24379: Revert the operator.subscript patch (dccc4e63aef5) pending resolution of the related refcnt leak.
files:
Doc/library/operator.rst | 15 ------------
Doc/whatsnew/3.6.rst | 8 ------
Lib/operator.py | 28 +----------------------
Lib/test/test_operator.py | 33 ---------------------------
4 files changed, 1 insertions(+), 83 deletions(-)
diff --git a/Doc/library/operator.rst b/Doc/library/operator.rst
--- a/Doc/library/operator.rst
+++ b/Doc/library/operator.rst
@@ -333,21 +333,6 @@
[('orange', 1), ('banana', 2), ('apple', 3), ('pear', 5)]
-.. data:: subscript
-
- A helper to turn subscript notation into indexing objects. This can be
- used to create item access patterns ahead of time to pass them into
- various subscriptable objects.
-
- For example:
-
- * ``subscript[5] == 5``
- * ``subscript[3:7:2] == slice(3, 7, 2)``
- * ``subscript[5, 8] == (5, 8)``
-
- .. versionadded:: 3.6
-
-
.. function:: methodcaller(name[, args...])
Return a callable object that calls the method *name* on its operand. If
diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst
--- a/Doc/whatsnew/3.6.rst
+++ b/Doc/whatsnew/3.6.rst
@@ -104,14 +104,6 @@
(Contributed by Ashley Anderson in :issue:`12006`.)
-operator
---------
-
-New object :data:`operator.subscript` makes it easier to create complex
-indexers. For example: ``subscript[0:10:2] == slice(0, 10, 2)``
-(Contributed by Joe Jevnik in :issue:`24379`.)
-
-
pickle
------
diff --git a/Lib/operator.py b/Lib/operator.py
--- a/Lib/operator.py
+++ b/Lib/operator.py
@@ -17,7 +17,7 @@
'is_', 'is_not', 'isub', 'itemgetter', 'itruediv', 'ixor', 'le',
'length_hint', 'lshift', 'lt', 'matmul', 'methodcaller', 'mod',
'mul', 'ne', 'neg', 'not_', 'or_', 'pos', 'pow', 'rshift',
- 'setitem', 'sub', 'subscript', 'truediv', 'truth', 'xor']
+ 'setitem', 'sub', 'truediv', 'truth', 'xor']
from builtins import abs as _abs
@@ -408,32 +408,6 @@
return a
-(a)object.__new__ # create a singleton instance
-class subscript:
- """
- A helper to turn subscript notation into indexing objects. This can be
- used to create item access patterns ahead of time to pass them into
- various subscriptable objects.
-
- For example:
- subscript[5] == 5
- subscript[3:7:2] == slice(3, 7, 2)
- subscript[5, 8] == (5, 8)
- """
- __slots__ = ()
-
- def __new__(cls):
- raise TypeError("cannot create '{}' instances".format(cls.__name__))
-
- @staticmethod
- def __getitem__(key):
- return key
-
- @staticmethod
- def __reduce__():
- return 'subscript'
-
-
try:
from _operator import *
except ImportError:
diff --git a/Lib/test/test_operator.py b/Lib/test/test_operator.py
--- a/Lib/test/test_operator.py
+++ b/Lib/test/test_operator.py
@@ -596,38 +596,5 @@
module2 = c_operator
-class SubscriptTestCase:
- def test_subscript(self):
- subscript = self.module.subscript
- self.assertIsNone(subscript[None])
- self.assertEqual(subscript[0], 0)
- self.assertEqual(subscript[0:1:2], slice(0, 1, 2))
- self.assertEqual(
- subscript[0, ..., :2, ...],
- (0, Ellipsis, slice(2), Ellipsis),
- )
-
- def test_pickle(self):
- from operator import subscript
- for proto in range(pickle.HIGHEST_PROTOCOL + 1):
- with self.subTest(proto=proto):
- self.assertIs(
- pickle.loads(pickle.dumps(subscript, proto)),
- subscript,
- )
-
- def test_singleton(self):
- with self.assertRaises(TypeError):
- type(self.module.subscript)()
-
- def test_immutable(self):
- with self.assertRaises(AttributeError):
- self.module.subscript.attr = None
-
-
-class PySubscriptTestCase(SubscriptTestCase, PyOperatorTestCase):
- pass
-
-
if __name__ == "__main__":
unittest.main()
--
Repository URL: https://hg.python.org/cpython
1
0
cpython: Move the initial start-search out of the main loop so it can be factored-out
by raymond.hettinger Nov. 2, 2015
by raymond.hettinger Nov. 2, 2015
Nov. 2, 2015
https://hg.python.org/cpython/rev/9d7848bd2302
changeset: 98932:9d7848bd2302
parent: 98927:9f8b5053e30d
user: Raymond Hettinger <python(a)rcn.com>
date: Sun Nov 01 23:57:37 2015 -0500
summary:
Move the initial start-search out of the main loop so it can be factored-out later.
files:
Modules/_collectionsmodule.c | 43 +++++++++++++++--------
1 files changed, 27 insertions(+), 16 deletions(-)
diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c
--- a/Modules/_collectionsmodule.c
+++ b/Modules/_collectionsmodule.c
@@ -1017,11 +1017,12 @@
static PyObject *
deque_index(dequeobject *deque, PyObject *args)
{
- Py_ssize_t i, start=0, stop=Py_SIZE(deque);
+ Py_ssize_t i, n, start=0, stop=Py_SIZE(deque);
PyObject *v, *item;
block *b = deque->leftblock;
Py_ssize_t index = deque->leftindex;
size_t start_state = deque->state;
+ int cmp;
if (!PyArg_ParseTuple(args, "O|O&O&:index", &v,
_PyEval_SliceIndex, &start,
@@ -1039,22 +1040,32 @@
}
if (stop > Py_SIZE(deque))
stop = Py_SIZE(deque);
+ if (start > stop)
+ start = stop;
+ assert(0 <= start && start <= stop && stop <= Py_SIZE(deque));
- for (i=0 ; i<stop ; i++) {
- if (i >= start) {
- int cmp;
- CHECK_NOT_END(b);
- item = b->data[index];
- cmp = PyObject_RichCompareBool(item, v, Py_EQ);
- if (cmp > 0)
- return PyLong_FromSsize_t(i);
- else if (cmp < 0)
- return NULL;
- if (start_state != deque->state) {
- PyErr_SetString(PyExc_RuntimeError,
- "deque mutated during iteration");
- return NULL;
- }
+ /* XXX Replace this loop with faster code from deque_item() */
+ for (i=0 ; i<start ; i++) {
+ index++;
+ if (index == BLOCKLEN) {
+ b = b->rightlink;
+ index = 0;
+ }
+ }
+
+ n = stop - i;
+ while (n--) {
+ CHECK_NOT_END(b);
+ item = b->data[index];
+ cmp = PyObject_RichCompareBool(item, v, Py_EQ);
+ if (cmp > 0)
+ return PyLong_FromSsize_t(stop - (n + 1));
+ else if (cmp < 0)
+ return NULL;
+ if (start_state != deque->state) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "deque mutated during iteration");
+ return NULL;
}
index++;
if (index == BLOCKLEN) {
--
Repository URL: https://hg.python.org/cpython
1
0