Issue #26916: Fixed words duplications.
This commit is contained in:
parent
5999b23389
commit
3dad438872
|
@ -258,7 +258,7 @@ How to Make A Release
|
||||||
|
|
||||||
___ Add a new whatsnew/3.x.rst file (with the comment near the top
|
___ Add a new whatsnew/3.x.rst file (with the comment near the top
|
||||||
and the toplevel sections copied from the previous file) and
|
and the toplevel sections copied from the previous file) and
|
||||||
and add it to the toctree in whatsnew/index.rst.
|
add it to the toctree in whatsnew/index.rst.
|
||||||
|
|
||||||
___ Update the version number in configure.ac and re-run autoconf.
|
___ Update the version number in configure.ac and re-run autoconf.
|
||||||
|
|
||||||
|
|
|
@ -364,7 +364,7 @@ Appendix -- Dianne Hackborn's vref proposal (1995)
|
||||||
|
|
||||||
An example vref module using this model could include the
|
An example vref module using this model could include the
|
||||||
function "new"; When used as 'MyVref = vref.new(MyObject)', it
|
function "new"; When used as 'MyVref = vref.new(MyObject)', it
|
||||||
returns a new vref object such that that MyVref.object ==
|
returns a new vref object such that MyVref.object ==
|
||||||
MyObject. MyVref.object would then change to Nothing if
|
MyObject. MyVref.object would then change to Nothing if
|
||||||
MyObject is ever deallocated.
|
MyObject is ever deallocated.
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ Specification
|
||||||
style operations if the number indicates the availability of these.
|
style operations if the number indicates the availability of these.
|
||||||
|
|
||||||
A new style number is considered by the interpreter as such if and
|
A new style number is considered by the interpreter as such if and
|
||||||
only it it sets the type flag Py_TPFLAGS_CHECKTYPES. The main
|
only if it sets the type flag Py_TPFLAGS_CHECKTYPES. The main
|
||||||
difference between an old style number and a new style one is that the
|
difference between an old style number and a new style one is that the
|
||||||
numeric slot functions can no longer assume to be passed arguments of
|
numeric slot functions can no longer assume to be passed arguments of
|
||||||
identical type. New style slots must check all arguments for proper
|
identical type. New style slots must check all arguments for proper
|
||||||
|
|
|
@ -140,7 +140,7 @@ Incompatibilities
|
||||||
inclusive) are "interned" -- whenever a result has such a value,
|
inclusive) are "interned" -- whenever a result has such a value,
|
||||||
an existing short int with the same value is returned. This is
|
an existing short int with the same value is returned. This is
|
||||||
not done for long ints with the same values. This difference
|
not done for long ints with the same values. This difference
|
||||||
will remain. (Since there is no guarantee of this interning, is
|
will remain. (Since there is no guarantee of this interning, it
|
||||||
is debatable whether this is a semantic difference -- but code
|
is debatable whether this is a semantic difference -- but code
|
||||||
may exist that uses 'is' for comparisons of short ints and
|
may exist that uses 'is' for comparisons of short ints and
|
||||||
happens to work because of this interning. Such code may fail
|
happens to work because of this interning. Such code may fail
|
||||||
|
@ -291,7 +291,7 @@ OverflowWarning
|
||||||
Example
|
Example
|
||||||
|
|
||||||
If you pass a long int to a C function or built-in operation that
|
If you pass a long int to a C function or built-in operation that
|
||||||
takes an integer, it will be treated the same as as a short int as
|
takes an integer, it will be treated the same as a short int as
|
||||||
long as the value fits (by virtue of how PyArg_ParseTuple() is
|
long as the value fits (by virtue of how PyArg_ParseTuple() is
|
||||||
implemented). If the long value doesn't fit, it will still raise
|
implemented). If the long value doesn't fit, it will still raise
|
||||||
an OverflowError. For example:
|
an OverflowError. For example:
|
||||||
|
|
|
@ -199,7 +199,7 @@ Making a type a factory for its instances
|
||||||
callable. Since type objects are instances of their metatype
|
callable. Since type objects are instances of their metatype
|
||||||
(PyType_Type), the metatype's tp_call slot (PyType_Type.tp_call)
|
(PyType_Type), the metatype's tp_call slot (PyType_Type.tp_call)
|
||||||
points to a function that is invoked when any type object is
|
points to a function that is invoked when any type object is
|
||||||
called. Now, since each type has do do something different to
|
called. Now, since each type has to do something different to
|
||||||
create an instance of itself, PyType_Type.tp_call immediately
|
create an instance of itself, PyType_Type.tp_call immediately
|
||||||
defers to the tp_new slot of the type that is being called.
|
defers to the tp_new slot of the type that is being called.
|
||||||
PyType_Type itself is also callable: its tp_new slot creates a new
|
PyType_Type itself is also callable: its tp_new slot creates a new
|
||||||
|
@ -271,7 +271,7 @@ Making a type a factory for its instances
|
||||||
tp_new() is the type that defined the tp_new() function (in the
|
tp_new() is the type that defined the tp_new() function (in the
|
||||||
example, if type == &PyInt_Type), and when the tp_init() slot for
|
example, if type == &PyInt_Type), and when the tp_init() slot for
|
||||||
this type does nothing. If the type argument differs, the
|
this type does nothing. If the type argument differs, the
|
||||||
tp_new() call is initiated by by a derived type's tp_new() to
|
tp_new() call is initiated by a derived type's tp_new() to
|
||||||
create the object and initialize the base type portion of the
|
create the object and initialize the base type portion of the
|
||||||
object; in this case tp_new() should always return a new object
|
object; in this case tp_new() should always return a new object
|
||||||
(or raise an exception).
|
(or raise an exception).
|
||||||
|
|
|
@ -73,7 +73,7 @@ Database Contents
|
||||||
|
|
||||||
A distribution that uses the Distutils for installation should
|
A distribution that uses the Distutils for installation should
|
||||||
automatically update the database. Distributions that roll their
|
automatically update the database. Distributions that roll their
|
||||||
own installation will have to use the database's API to to
|
own installation will have to use the database's API to
|
||||||
manually add or update their own entry. System package managers
|
manually add or update their own entry. System package managers
|
||||||
such as RPM or pkgadd can just create the new file in the
|
such as RPM or pkgadd can just create the new file in the
|
||||||
INSTALLDB directory.
|
INSTALLDB directory.
|
||||||
|
|
|
@ -252,7 +252,7 @@ YODL, AFT, ...) which are not mentioned.
|
||||||
|
|
||||||
- SText implementations have been buggy.
|
- SText implementations have been buggy.
|
||||||
|
|
||||||
- Most STexts have have had no formal specification except for the
|
- Most STexts have no formal specification except for the
|
||||||
implementation itself. A buggy implementation meant a buggy spec,
|
implementation itself. A buggy implementation meant a buggy spec,
|
||||||
and vice-versa.
|
and vice-versa.
|
||||||
|
|
||||||
|
|
|
@ -179,7 +179,7 @@ containing the source file is not writable by the current user a
|
||||||
performance penalty is incurred each time a program importing the
|
performance penalty is incurred each time a program importing the
|
||||||
module is run. [3]_ Warning messages may also be generated in certain
|
module is run. [3]_ Warning messages may also be generated in certain
|
||||||
circumstances. If the directory is writable, nearly simultaneous
|
circumstances. If the directory is writable, nearly simultaneous
|
||||||
attempts attempts to write the bytecode file by two separate processes
|
attempts to write the bytecode file by two separate processes
|
||||||
may occur, resulting in file corruption. [4]_
|
may occur, resulting in file corruption. [4]_
|
||||||
|
|
||||||
In environments with RAM disks available, it may be desirable for
|
In environments with RAM disks available, it may be desirable for
|
||||||
|
|
|
@ -244,7 +244,7 @@ used as a sentinel value for maximum values "in the wild", even though
|
||||||
None itself compares smaller than any other object in the standard
|
None itself compares smaller than any other object in the standard
|
||||||
distribution.
|
distribution.
|
||||||
|
|
||||||
As an aside, it is not clear to to the author that using Nodes as a
|
As an aside, it is not clear to the author that using Nodes as a
|
||||||
replacement for tuples has increased readability significantly, if at
|
replacement for tuples has increased readability significantly, if at
|
||||||
all.
|
all.
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,7 @@ Rationale
|
||||||
|
|
||||||
To keep things simpler, the C API calls for setting an exception
|
To keep things simpler, the C API calls for setting an exception
|
||||||
will not automatically set the exception's '__context__'. Guido
|
will not automatically set the exception's '__context__'. Guido
|
||||||
van Rossum has has expressed concerns with making such changes [8].
|
van Rossum has expressed concerns with making such changes [8].
|
||||||
|
|
||||||
As for other languages, Java and Ruby both discard the original
|
As for other languages, Java and Ruby both discard the original
|
||||||
exception when another exception occurs in a 'catch'/'rescue' or
|
exception when another exception occurs in a 'catch'/'rescue' or
|
||||||
|
|
|
@ -67,7 +67,7 @@ Motivation
|
||||||
|
|
||||||
Currently, Python has a large number of different functions
|
Currently, Python has a large number of different functions
|
||||||
scattered over half a dozen modules for handling paths. This
|
scattered over half a dozen modules for handling paths. This
|
||||||
makes it hard for newbies and experienced developers to to choose
|
makes it hard for newbies and experienced developers to choose
|
||||||
the right method.
|
the right method.
|
||||||
|
|
||||||
The Path class provides the following enhancements over the
|
The Path class provides the following enhancements over the
|
||||||
|
|
|
@ -495,7 +495,7 @@ The patches could be created with
|
||||||
``git diff master > stuff-i-did.patch``, too, but
|
``git diff master > stuff-i-did.patch``, too, but
|
||||||
``git format-patch | git am`` knows some tricks
|
``git format-patch | git am`` knows some tricks
|
||||||
(empty files, renames, etc) that ordinary patch can't handle. git
|
(empty files, renames, etc) that ordinary patch can't handle. git
|
||||||
grabs "Stuff I did" out of the the commit message to create the file
|
grabs "Stuff I did" out of the commit message to create the file
|
||||||
name 0001-Stuff-I-did.patch. See Patch Review below for a
|
name 0001-Stuff-I-did.patch. See Patch Review below for a
|
||||||
description of the git-format-patch format.
|
description of the git-format-patch format.
|
||||||
::
|
::
|
||||||
|
@ -1322,7 +1322,7 @@ is likely to shock a veteran CVS user.
|
||||||
Tests/Impressions
|
Tests/Impressions
|
||||||
=================
|
=================
|
||||||
|
|
||||||
As I (Brett Cannon) am left with the task of of making the final
|
As I (Brett Cannon) am left with the task of making the final
|
||||||
decision of which/any DVCS to go with and not my co-authors, I felt
|
decision of which/any DVCS to go with and not my co-authors, I felt
|
||||||
it only fair to write down what tests I ran and my impressions as I
|
it only fair to write down what tests I ran and my impressions as I
|
||||||
evaluate the various tools so as to be as transparent as possible.
|
evaluate the various tools so as to be as transparent as possible.
|
||||||
|
|
|
@ -240,7 +240,7 @@ From the doc::
|
||||||
Finally, to handle miscellaneous cases, the strings "pre", "preview", and
|
Finally, to handle miscellaneous cases, the strings "pre", "preview", and
|
||||||
"rc" are treated as if they were "c", i.e. as though they were release
|
"rc" are treated as if they were "c", i.e. as though they were release
|
||||||
candidates, and therefore are not as new as a version string that does not
|
candidates, and therefore are not as new as a version string that does not
|
||||||
contain them, and "dev" is replaced with an '@' so that it sorts lower than
|
contain them, and "dev" is replaced with an '@' so that it sorts lower
|
||||||
than any other pre-release tag.
|
than any other pre-release tag.
|
||||||
|
|
||||||
In other words, ``parse_version`` will return a tuple for each version string,
|
In other words, ``parse_version`` will return a tuple for each version string,
|
||||||
|
|
|
@ -212,7 +212,7 @@ have that extra condition marker.
|
||||||
Compatiblity
|
Compatiblity
|
||||||
============
|
============
|
||||||
|
|
||||||
This change is is based on a new metadata ``1.2`` format meaning that
|
This change is based on a new metadata ``1.2`` format meaning that
|
||||||
Distutils will be able to distinguish old PKG-INFO files from new ones.
|
Distutils will be able to distinguish old PKG-INFO files from new ones.
|
||||||
|
|
||||||
The ``setup.cfg`` file change will stay ``ConfigParser``-compatible and
|
The ``setup.cfg`` file change will stay ``ConfigParser``-compatible and
|
||||||
|
|
|
@ -103,7 +103,7 @@ regard to ``sys.exec_prefix``. (``sys.exec_prefix`` is the equivalent of
|
||||||
same value as ``sys.prefix``.)
|
same value as ``sys.prefix``.)
|
||||||
|
|
||||||
The ``site`` and ``sysconfig`` standard-library modules are modified
|
The ``site`` and ``sysconfig`` standard-library modules are modified
|
||||||
such that the standard library and header files are are found relative
|
such that the standard library and header files are found relative
|
||||||
to ``sys.base_prefix`` / ``sys.base_exec_prefix``, while site-package
|
to ``sys.base_prefix`` / ``sys.base_exec_prefix``, while site-package
|
||||||
directories ("purelib" and "platlib", in ``sysconfig`` terms) are still
|
directories ("purelib" and "platlib", in ``sysconfig`` terms) are still
|
||||||
found relative to ``sys.prefix`` / ``sys.exec_prefix``.
|
found relative to ``sys.prefix`` / ``sys.exec_prefix``.
|
||||||
|
|
|
@ -83,7 +83,7 @@ In any case, modules that are proposed to be added to the standard library,
|
||||||
whether via ``__preview__`` or directly, must fulfill the acceptance conditions
|
whether via ``__preview__`` or directly, must fulfill the acceptance conditions
|
||||||
set by PEP 2.
|
set by PEP 2.
|
||||||
|
|
||||||
It is important to stress that the aim of of this proposal is not to make the
|
It is important to stress that the aim of this proposal is not to make the
|
||||||
process of adding new modules to the standard library more difficult. On the
|
process of adding new modules to the standard library more difficult. On the
|
||||||
contrary, it tries to provide a means to add *more* useful libraries. Modules
|
contrary, it tries to provide a means to add *more* useful libraries. Modules
|
||||||
which are obvious candidates for entry can be added as before. Modules which
|
which are obvious candidates for entry can be added as before. Modules which
|
||||||
|
@ -118,7 +118,7 @@ API for the problem it intends to solve. The module can then be added to the
|
||||||
|
|
||||||
from __preview__ import example
|
from __preview__ import example
|
||||||
|
|
||||||
Assuming the module is then promoted to the the standard library proper in
|
Assuming the module is then promoted to the standard library proper in
|
||||||
release ``3.X+1``, it will be moved to a permanent location in the library::
|
release ``3.X+1``, it will be moved to a permanent location in the library::
|
||||||
|
|
||||||
import example
|
import example
|
||||||
|
|
|
@ -23,7 +23,7 @@ feature release. A provisional package may have its API modified prior to
|
||||||
"graduating" into a "stable" state. On one hand, this state provides the
|
"graduating" into a "stable" state. On one hand, this state provides the
|
||||||
package with the benefits of being formally part of the Python distribution.
|
package with the benefits of being formally part of the Python distribution.
|
||||||
On the other hand, the core development team explicitly states that no promises
|
On the other hand, the core development team explicitly states that no promises
|
||||||
are made with regards to the the stability of the package's API, which may
|
are made with regards to the stability of the package's API, which may
|
||||||
change for the next release. While it is considered an unlikely outcome,
|
change for the next release. While it is considered an unlikely outcome,
|
||||||
such packages may even be removed from the standard library without a
|
such packages may even be removed from the standard library without a
|
||||||
deprecation period if the concerns regarding their API or maintenance prove
|
deprecation period if the concerns regarding their API or maintenance prove
|
||||||
|
|
|
@ -100,7 +100,7 @@ Implementation
|
||||||
Recipe: hashable dict
|
Recipe: hashable dict
|
||||||
======================
|
======================
|
||||||
|
|
||||||
To ensure that a a frozendict is hashable, values can be checked
|
To ensure that a frozendict is hashable, values can be checked
|
||||||
before creating the frozendict::
|
before creating the frozendict::
|
||||||
|
|
||||||
import itertools
|
import itertools
|
||||||
|
|
|
@ -652,7 +652,7 @@ On Linux older than 2.6.27, if the ``SOCK_CLOEXEC`` flag is set in the
|
||||||
socket type, ``socket()`` or ``socketpair()`` fail and ``errno`` is set
|
socket type, ``socket()`` or ``socketpair()`` fail and ``errno`` is set
|
||||||
to ``EINVAL``.
|
to ``EINVAL``.
|
||||||
|
|
||||||
On Windows XPS3, ``WSASocket()`` with with ``WSAEPROTOTYPE`` when
|
On Windows XPS3, ``WSASocket()`` with ``WSAEPROTOTYPE`` when
|
||||||
``WSA_FLAG_NO_HANDLE_INHERIT`` flag is used.
|
``WSA_FLAG_NO_HANDLE_INHERIT`` flag is used.
|
||||||
|
|
||||||
New functions:
|
New functions:
|
||||||
|
|
|
@ -315,7 +315,7 @@ a *return converter*.
|
||||||
Parameter Declaration
|
Parameter Declaration
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
The full form of the parameter declaration line as as follows::
|
The full form of the parameter declaration line as follows::
|
||||||
|
|
||||||
name: converter [ (parameter=value [, parameter2=value2]) ] [ = default]
|
name: converter [ (parameter=value [, parameter2=value2]) ] [ = default]
|
||||||
|
|
||||||
|
|
|
@ -132,7 +132,7 @@ Public or Private Mirrors
|
||||||
=========================
|
=========================
|
||||||
|
|
||||||
The mirroring protocol will continue to exist as defined in `PEP381`_ and
|
The mirroring protocol will continue to exist as defined in `PEP381`_ and
|
||||||
people are encouraged to to host public and private mirrors if they so desire.
|
people are encouraged to host public and private mirrors if they so desire.
|
||||||
The recommended mirroring client is `Bandersnatch`_.
|
The recommended mirroring client is `Bandersnatch`_.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@ Specification
|
||||||
of the hash algorithm in bytes. The block size is used by the
|
of the hash algorithm in bytes. The block size is used by the
|
||||||
HMAC module to pad the secret key to digest_size or to hash the
|
HMAC module to pad the secret key to digest_size or to hash the
|
||||||
secret key if it is longer than digest_size. If no HMAC
|
secret key if it is longer than digest_size. If no HMAC
|
||||||
algorithm is standardized for the the hash algorithm, return
|
algorithm is standardized for the hash algorithm, return
|
||||||
``NotImplemented`` instead.
|
``NotImplemented`` instead.
|
||||||
|
|
||||||
name
|
name
|
||||||
|
|
|
@ -202,7 +202,7 @@ Functions
|
||||||
store more frames.
|
store more frames.
|
||||||
|
|
||||||
The ``tracemalloc`` module must be tracing memory allocations to
|
The ``tracemalloc`` module must be tracing memory allocations to
|
||||||
take a snapshot, see the the ``start()`` function.
|
take a snapshot, see the ``start()`` function.
|
||||||
|
|
||||||
See also the ``get_object_traceback()`` function.
|
See also the ``get_object_traceback()`` function.
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ is mapped to ``-2``.
|
||||||
Current implementation with modified FNV
|
Current implementation with modified FNV
|
||||||
========================================
|
========================================
|
||||||
|
|
||||||
CPython currently uses uses a variant of the Fowler-Noll-Vo hash function
|
CPython currently uses a variant of the Fowler-Noll-Vo hash function
|
||||||
[fnv]_. The variant is has been modified to reduce the amount and cost of hash
|
[fnv]_. The variant is has been modified to reduce the amount and cost of hash
|
||||||
collisions for common strings. The first character of the string is added
|
collisions for common strings. The first character of the string is added
|
||||||
twice, the first time with a bit shift of 7. The length of the input
|
twice, the first time with a bit shift of 7. The length of the input
|
||||||
|
@ -595,7 +595,7 @@ the past, but are not subject of this PEP.
|
||||||
|
|
||||||
3. Hash maps have a worst case of O(n) for insertion and lookup of keys. This
|
3. Hash maps have a worst case of O(n) for insertion and lookup of keys. This
|
||||||
results in a quadratic runtime during a hash collision attack. The
|
results in a quadratic runtime during a hash collision attack. The
|
||||||
introduction of a new and additional data structure with with O(log n)
|
introduction of a new and additional data structure with O(log n)
|
||||||
worst case behavior would eliminate the root cause. A data structures like
|
worst case behavior would eliminate the root cause. A data structures like
|
||||||
red-black-tree or prefix trees (trie [trie]_) would have other benefits,
|
red-black-tree or prefix trees (trie [trie]_) would have other benefits,
|
||||||
too. Prefix trees with stringed keyed can reduce memory usage as common
|
too. Prefix trees with stringed keyed can reduce memory usage as common
|
||||||
|
|
|
@ -1082,7 +1082,7 @@ Roger Dingledine, Sebastian Hahn, Nick Mathewson, Martin Peck and Justin Samuel
|
||||||
helped us to design TUF from its predecessor Thandy of the Tor project.
|
helped us to design TUF from its predecessor Thandy of the Tor project.
|
||||||
|
|
||||||
We appreciate the efforts of Konstantin Andrianov, Geremy Condra, Zane Fisher,
|
We appreciate the efforts of Konstantin Andrianov, Geremy Condra, Zane Fisher,
|
||||||
Justin Samuel, Tian Tian, Santiago Torres, John Ward, and Yuyu Zheng to to
|
Justin Samuel, Tian Tian, Santiago Torres, John Ward, and Yuyu Zheng to
|
||||||
develop TUF.
|
develop TUF.
|
||||||
|
|
||||||
Vladimir Diaz, Monzur Muhammad and Sai Teja Peddinti helped us to review this
|
Vladimir Diaz, Monzur Muhammad and Sai Teja Peddinti helped us to review this
|
||||||
|
|
|
@ -111,7 +111,7 @@ Criticisms
|
||||||
* In 3.3 encoding to ASCII or latin-1 is as fast as memcpy (but it still
|
* In 3.3 encoding to ASCII or latin-1 is as fast as memcpy (but it still
|
||||||
creates a separate object).
|
creates a separate object).
|
||||||
* Developers will have to work around the lack of binary formatting anyway,
|
* Developers will have to work around the lack of binary formatting anyway,
|
||||||
if they want to to support Python 3.4 and earlier.
|
if they want to support Python 3.4 and earlier.
|
||||||
* bytes.join() is consistently faster than format to join bytes strings
|
* bytes.join() is consistently faster than format to join bytes strings
|
||||||
(XXX *is it?*).
|
(XXX *is it?*).
|
||||||
* Formatting functions could be implemented in a third party module,
|
* Formatting functions could be implemented in a third party module,
|
||||||
|
|
|
@ -637,7 +637,7 @@ colon in the proposal much more obvious::
|
||||||
|
|
||||||
`Tcl`__ has the other half of Lua's xpcall; catch is a function which returns
|
`Tcl`__ has the other half of Lua's xpcall; catch is a function which returns
|
||||||
true if an exception was caught, false otherwise, and you get the value out
|
true if an exception was caught, false otherwise, and you get the value out
|
||||||
in other ways. And it's all built around the the implicit quote-and-exec
|
in other ways. And it's all built around the implicit quote-and-exec
|
||||||
that everything in Tcl is based on, making it even harder to describe in
|
that everything in Tcl is based on, making it even harder to describe in
|
||||||
Python terms than Lisp macros, but something like
|
Python terms than Lisp macros, but something like
|
||||||
|
|
||||||
|
|
|
@ -208,7 +208,7 @@ numeric operators also apply in an elementwise manner to arrays; the
|
||||||
reverse convention would lead to more special cases.)
|
reverse convention would lead to more special cases.)
|
||||||
|
|
||||||
So that's why matrix multiplication doesn't and can't just use ``*``.
|
So that's why matrix multiplication doesn't and can't just use ``*``.
|
||||||
Now, in the the rest of this section, we'll explain why it nonetheless
|
Now, in the rest of this section, we'll explain why it nonetheless
|
||||||
meets the high bar for adding a new operator.
|
meets the high bar for adding a new operator.
|
||||||
|
|
||||||
|
|
||||||
|
@ -1195,7 +1195,7 @@ References
|
||||||
test the null hypothesis that :math:`H\beta = r`; a large :math:`S`
|
test the null hypothesis that :math:`H\beta = r`; a large :math:`S`
|
||||||
then indicates that this hypothesis is unlikely to be true. For
|
then indicates that this hypothesis is unlikely to be true. For
|
||||||
example, in an analysis of human height, the vector :math:`\beta`
|
example, in an analysis of human height, the vector :math:`\beta`
|
||||||
might contain one value which was the the average height of the
|
might contain one value which was the average height of the
|
||||||
measured men, and another value which was the average height of the
|
measured men, and another value which was the average height of the
|
||||||
measured women, and then setting :math:`H = [1, -1], r = 0` would
|
measured women, and then setting :math:`H = [1, -1], r = 0` would
|
||||||
let us test whether men and women are the same height on
|
let us test whether men and women are the same height on
|
||||||
|
|
|
@ -136,7 +136,7 @@ Besides, some signals are not interesting and should not disrupt the
|
||||||
application. There are two options to interrupt an application on
|
application. There are two options to interrupt an application on
|
||||||
only *some* signals:
|
only *some* signals:
|
||||||
|
|
||||||
* Set up a custom signal signal handler which raises an exception, such as
|
* Set up a custom signal handler which raises an exception, such as
|
||||||
``KeyboardInterrupt`` for ``SIGINT``.
|
``KeyboardInterrupt`` for ``SIGINT``.
|
||||||
* Use a I/O multiplexing function like ``select()`` together with Python's
|
* Use a I/O multiplexing function like ``select()`` together with Python's
|
||||||
signal wakeup file descriptor: see the function ``signal.set_wakeup_fd()``.
|
signal wakeup file descriptor: see the function ``signal.set_wakeup_fd()``.
|
||||||
|
|
|
@ -1414,7 +1414,7 @@ Convenience definitions:
|
||||||
``NamedTuple(type_name, [(field_name, field_type), ...])``
|
``NamedTuple(type_name, [(field_name, field_type), ...])``
|
||||||
and equivalent to
|
and equivalent to
|
||||||
``collections.namedtuple(type_name, [field_name, ...])``.
|
``collections.namedtuple(type_name, [field_name, ...])``.
|
||||||
This is useful to declare the types of the fields of a a named tuple
|
This is useful to declare the types of the fields of a named tuple
|
||||||
type.
|
type.
|
||||||
|
|
||||||
* cast(), described earlier
|
* cast(), described earlier
|
||||||
|
|
|
@ -57,7 +57,7 @@ virtualenv::
|
||||||
pip install pytest
|
pip install pytest
|
||||||
py.test
|
py.test
|
||||||
|
|
||||||
Having to use different commands is is error-prone, and in many cases
|
Having to use different commands is error-prone, and in many cases
|
||||||
the error is difficult to spot immediately. The PEP proposes making
|
the error is difficult to spot immediately. The PEP proposes making
|
||||||
the ``py`` command usable with virtual environments, so that the first
|
the ``py`` command usable with virtual environments, so that the first
|
||||||
form of command can be used in all cases.
|
form of command can be used in all cases.
|
||||||
|
|
|
@ -296,7 +296,7 @@ For example, this code::
|
||||||
|
|
||||||
f'abc{expr1:spec1}{expr2!r:spec2}def{expr3}ghi'
|
f'abc{expr1:spec1}{expr2!r:spec2}def{expr3}ghi'
|
||||||
|
|
||||||
Might be be evaluated as::
|
Might be evaluated as::
|
||||||
|
|
||||||
'abc' + format(expr1, spec1) + format(repr(expr2), spec2) + 'def' + format(expr3) + 'ghi'
|
'abc' + format(expr1, spec1) + format(repr(expr2), spec2) + 'def' + format(expr3) + 'ghi'
|
||||||
|
|
||||||
|
|
|
@ -302,7 +302,7 @@ from a SQL database and formats it as JSON to send to an HTTP client::
|
||||||
|
|
||||||
Both ``first_seen`` and ``last_seen`` are allowed to be ``null`` in the
|
Both ``first_seen`` and ``last_seen`` are allowed to be ``null`` in the
|
||||||
database, and they are also allowed to be ``null`` in the JSON response. JSON
|
database, and they are also allowed to be ``null`` in the JSON response. JSON
|
||||||
does not have a native way to represent a ``datetime``, so the the server's
|
does not have a native way to represent a ``datetime``, so the server's
|
||||||
contract states that any non-``null`` date is represented as a ISO-8601 string.
|
contract states that any non-``null`` date is represented as a ISO-8601 string.
|
||||||
|
|
||||||
Note that this code is invalid by PEP-8 standards: several lines are over the
|
Note that this code is invalid by PEP-8 standards: several lines are over the
|
||||||
|
@ -925,7 +925,7 @@ as the ``None``-coalescing operator.
|
||||||
|
|
||||||
The ``None``-aware attribute access operator (also called "safe navigation")
|
The ``None``-aware attribute access operator (also called "safe navigation")
|
||||||
checks its left operand. If the left operand is ``None``, then the operator
|
checks its left operand. If the left operand is ``None``, then the operator
|
||||||
evaluates to ``None``. If the the left operand is not ``None``, then the
|
evaluates to ``None``. If the left operand is not ``None``, then the
|
||||||
operator accesses the attribute named by the right operand. As in the previous
|
operator accesses the attribute named by the right operand. As in the previous
|
||||||
section, we continue to use the temporary spelling ``💩``::
|
section, we continue to use the temporary spelling ``💩``::
|
||||||
|
|
||||||
|
|
|
@ -457,7 +457,7 @@ Prior Art
|
||||||
Method cache and type version tag
|
Method cache and type version tag
|
||||||
---------------------------------
|
---------------------------------
|
||||||
|
|
||||||
In 2007, Armin Rigo wrote a patch to to implement a cache of methods. It
|
In 2007, Armin Rigo wrote a patch to implement a cache of methods. It
|
||||||
was merged into Python 2.6. The patch adds a "type attribute cache
|
was merged into Python 2.6. The patch adds a "type attribute cache
|
||||||
version tag" (``tp_version_tag``) and a "valid version tag" flag to
|
version tag" (``tp_version_tag``) and a "valid version tag" flag to
|
||||||
types (the ``PyTypeObject`` structure).
|
types (the ``PyTypeObject`` structure).
|
||||||
|
|
|
@ -348,7 +348,7 @@ have the same parameter defaults, the same keyword parameter defaults,
|
||||||
and must not have specialized code.
|
and must not have specialized code.
|
||||||
|
|
||||||
If *code* is a Python function or a code object, a new code object is
|
If *code* is a Python function or a code object, a new code object is
|
||||||
created and the code name and first number number of the code object of
|
created and the code name and first line number of the code object of
|
||||||
*func* are copied. The specialized code must have the same cell
|
*func* are copied. The specialized code must have the same cell
|
||||||
variables and the same free variables.
|
variables and the same free variables.
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,7 @@ specification is encoded in the source code and documentation of
|
||||||
to it as the ``setup.py``\-style.
|
to it as the ``setup.py``\-style.
|
||||||
|
|
||||||
Here we define a new ``pypackage.json``\-style source tree. This
|
Here we define a new ``pypackage.json``\-style source tree. This
|
||||||
consists of any any directory which contains a file named
|
consists of any directory which contains a file named
|
||||||
``pypackage.json``. (If a tree contains both ``pypackage.json`` and
|
``pypackage.json``. (If a tree contains both ``pypackage.json`` and
|
||||||
``setup.py`` then it is a ``pypackage.json``\-style source tree, and
|
``setup.py`` then it is a ``pypackage.json``\-style source tree, and
|
||||||
``pypackage.json``\-aware tools should ignore the ``setup.py``; this
|
``pypackage.json``\-aware tools should ignore the ``setup.py``; this
|
||||||
|
@ -560,7 +560,7 @@ demarcated).
|
||||||
In general, the need to isolate build backends into their own process
|
In general, the need to isolate build backends into their own process
|
||||||
means that we can't remove IPC complexity entirely -- but by placing
|
means that we can't remove IPC complexity entirely -- but by placing
|
||||||
both sides of the IPC channel under the control of a single project,
|
both sides of the IPC channel under the control of a single project,
|
||||||
we make it much much cheaper to fix bugs in the IPC interface than if
|
we make it much cheaper to fix bugs in the IPC interface than if
|
||||||
fixing bugs requires coordinated agreement and coordinated changes
|
fixing bugs requires coordinated agreement and coordinated changes
|
||||||
across the ecosystem.
|
across the ecosystem.
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,7 @@ Algol-style scoping model that is now standard in many programming
|
||||||
languages, including JavaScript, Perl, Ruby, Scheme, Smalltalk,
|
languages, including JavaScript, Perl, Ruby, Scheme, Smalltalk,
|
||||||
C with GNU extensions, and C# 2.0.
|
C with GNU extensions, and C# 2.0.
|
||||||
|
|
||||||
It has been argued that that such a feature isn't necessary, because
|
It has been argued that such a feature isn't necessary, because
|
||||||
a rebindable outer variable can be simulated by wrapping it in a
|
a rebindable outer variable can be simulated by wrapping it in a
|
||||||
mutable object::
|
mutable object::
|
||||||
|
|
||||||
|
|
|
@ -422,7 +422,7 @@ always read back exactly the characters you wrote.
|
||||||
Unicode encoding/decoding Issues
|
Unicode encoding/decoding Issues
|
||||||
--------------------------------
|
--------------------------------
|
||||||
|
|
||||||
We should allow allow changing the encoding and error-handling
|
We should allow changing the encoding and error-handling
|
||||||
setting later. The behavior of Text I/O operations in the face of
|
setting later. The behavior of Text I/O operations in the face of
|
||||||
Unicode problems and ambiguities (e.g. diacritics, surrogates, invalid
|
Unicode problems and ambiguities (e.g. diacritics, surrogates, invalid
|
||||||
bytes in an encoding) should be the same as that of the unicode
|
bytes in an encoding) should be the same as that of the unicode
|
||||||
|
|
|
@ -551,7 +551,7 @@ PyBUF_UPDATEIFCOPY to determine whether the returned buffer should be
|
||||||
readable, writable, or set to update the original buffer if a copy
|
readable, writable, or set to update the original buffer if a copy
|
||||||
must be made. If buffertype is PyBUF_WRITE and the buffer is not
|
must be made. If buffertype is PyBUF_WRITE and the buffer is not
|
||||||
contiguous an error will be raised. In this circumstance, the user
|
contiguous an error will be raised. In this circumstance, the user
|
||||||
can use PyBUF_UPDATEIFCOPY to ensure that a a writable temporary
|
can use PyBUF_UPDATEIFCOPY to ensure that a writable temporary
|
||||||
contiguous buffer is returned. The contents of this contiguous buffer
|
contiguous buffer is returned. The contents of this contiguous buffer
|
||||||
will be copied back into the original object after the memoryview
|
will be copied back into the original object after the memoryview
|
||||||
object is deleted as long as the original object is writable. If this
|
object is deleted as long as the original object is writable. If this
|
||||||
|
|
|
@ -250,7 +250,7 @@ B) or issubclass(type(x), B)``. (It is possible ``type(x)`` and
|
||||||
``x.__class__`` are not the same object, e.g. when x is a proxy
|
``x.__class__`` are not the same object, e.g. when x is a proxy
|
||||||
object.)
|
object.)
|
||||||
|
|
||||||
These methods are intended to be be called on classes whose metaclass
|
These methods are intended to be called on classes whose metaclass
|
||||||
is (derived from) ``ABCMeta``; for example::
|
is (derived from) ``ABCMeta``; for example::
|
||||||
|
|
||||||
from abc import ABCMeta
|
from abc import ABCMeta
|
||||||
|
|
|
@ -220,7 +220,7 @@ and an optional "predicate" object.
|
||||||
|
|
||||||
The default predicate implementation is a tuple of types with
|
The default predicate implementation is a tuple of types with
|
||||||
positional matching to the overloaded function's arguments. However,
|
positional matching to the overloaded function's arguments. However,
|
||||||
an arbitrary number of other kinds of of predicates can be created and
|
an arbitrary number of other kinds of predicates can be created and
|
||||||
registered using the `Extension API`_, and will then be usable with
|
registered using the `Extension API`_, and will then be usable with
|
||||||
``@when`` and other decorators created by this module (like
|
``@when`` and other decorators created by this module (like
|
||||||
``@before``, ``@after``, and ``@around``).
|
``@before``, ``@after``, and ``@around``).
|
||||||
|
|
|
@ -402,7 +402,7 @@ supporters and few, if any, staunch opponents, among the Python community.
|
||||||
Syntax for supported radices
|
Syntax for supported radices
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
This proposal is to to use a "0o" prefix with either uppercase
|
This proposal is to use a "0o" prefix with either uppercase
|
||||||
or lowercase "o" for octal, and a "0b" prefix with either
|
or lowercase "o" for octal, and a "0b" prefix with either
|
||||||
uppercase or lowercase "b" for binary.
|
uppercase or lowercase "b" for binary.
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,7 @@ Rationale
|
||||||
|
|
||||||
To keep things simpler, the C API calls for setting an exception
|
To keep things simpler, the C API calls for setting an exception
|
||||||
will not automatically set the exception's '__context__'. Guido
|
will not automatically set the exception's '__context__'. Guido
|
||||||
van Rossum has has expressed concerns with making such changes [8].
|
van Rossum has expressed concerns with making such changes [8].
|
||||||
|
|
||||||
As for other languages, Java and Ruby both discard the original
|
As for other languages, Java and Ruby both discard the original
|
||||||
exception when another exception occurs in a 'catch'/'rescue' or
|
exception when another exception occurs in a 'catch'/'rescue' or
|
||||||
|
|
|
@ -78,7 +78,7 @@ The second collections of items has been steadily increasing over the years
|
||||||
causing clutter in sys. Guido has even said he doesn't recognize some of things
|
causing clutter in sys. Guido has even said he doesn't recognize some of things
|
||||||
in it [#bug-1522]_!
|
in it [#bug-1522]_!
|
||||||
|
|
||||||
Moving these items items off to another module would send a clear message to
|
Moving these items off to another module would send a clear message to
|
||||||
other Python implementations about what functions need and need not be
|
other Python implementations about what functions need and need not be
|
||||||
implemented.
|
implemented.
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ Transition Plan
|
||||||
===============
|
===============
|
||||||
|
|
||||||
Once implemented in 3.x, the interpreter module will be back-ported to 2.6.
|
Once implemented in 3.x, the interpreter module will be back-ported to 2.6.
|
||||||
Py3k warnings will be added the the sys functions it replaces.
|
Py3k warnings will be added to the sys functions it replaces.
|
||||||
|
|
||||||
|
|
||||||
Open Issues
|
Open Issues
|
||||||
|
|
|
@ -150,7 +150,7 @@ References:
|
||||||
|
|
||||||
|
|
||||||
[1] Appealing to authority is a logical fallacy, but Vint Cerf is an
|
[1] Appealing to authority is a logical fallacy, but Vint Cerf is an
|
||||||
an authority who can't be ignored. Full text of the email
|
authority who can't be ignored. Full text of the email
|
||||||
follows:
|
follows:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -52,7 +52,7 @@ Rationale:
|
||||||
Windows builds of Python. Practically every I/O object in Python has a
|
Windows builds of Python. Practically every I/O object in Python has a
|
||||||
file-like wrapper of some sort. Sockets already act as such and for
|
file-like wrapper of some sort. Sockets already act as such and for
|
||||||
strings there is StringIO. Popen can be made to act like a file by simply
|
strings there is StringIO. Popen can be made to act like a file by simply
|
||||||
using the methods attached the the subprocess.Popen.stderr, stdout and
|
using the methods attached to the subprocess.Popen.stderr, stdout and
|
||||||
stdin file-like objects. But when using the read and write methods of
|
stdin file-like objects. But when using the read and write methods of
|
||||||
those options, you do not have the benefit of asynchronous I/O. In the
|
those options, you do not have the benefit of asynchronous I/O. In the
|
||||||
proposed solution the wrapper wraps the asynchronous methods to mimic a
|
proposed solution the wrapper wraps the asynchronous methods to mimic a
|
||||||
|
|
|
@ -389,11 +389,11 @@ Web Crawl Example
|
||||||
Rationale
|
Rationale
|
||||||
=========
|
=========
|
||||||
|
|
||||||
The proposed design of this module was heavily influenced by the the
|
The proposed design of this module was heavily influenced by the
|
||||||
Java java.util.concurrent package [1]_. The conceptual basis of the
|
Java java.util.concurrent package [1]_. The conceptual basis of the
|
||||||
module, as in Java, is the Future class, which represents the progress
|
module, as in Java, is the Future class, which represents the progress
|
||||||
and result of an asynchronous computation. The Future class makes
|
and result of an asynchronous computation. The Future class makes
|
||||||
little commitment to the evaluation mode being used e.g. it can be be
|
little commitment to the evaluation mode being used e.g. it can be
|
||||||
used to represent lazy or eager evaluation, for evaluation using
|
used to represent lazy or eager evaluation, for evaluation using
|
||||||
threads, processes or remote procedure call.
|
threads, processes or remote procedure call.
|
||||||
|
|
||||||
|
|
|
@ -984,7 +984,7 @@ public API is as follows, indicating the differences with PEP 3148:
|
||||||
|
|
||||||
- ``cancel()``. If the Future is already done (or cancelled), do
|
- ``cancel()``. If the Future is already done (or cancelled), do
|
||||||
nothing and return ``False``. Otherwise, this attempts to cancel
|
nothing and return ``False``. Otherwise, this attempts to cancel
|
||||||
the Future and returns ``True``. If the the cancellation attempt is
|
the Future and returns ``True``. If the cancellation attempt is
|
||||||
successful, eventually the Future's state will change to cancelled
|
successful, eventually the Future's state will change to cancelled
|
||||||
(so that ``cancelled()`` will return ``True``)
|
(so that ``cancelled()`` will return ``True``)
|
||||||
and the callbacks will be scheduled. For regular Futures,
|
and the callbacks will be scheduled. For regular Futures,
|
||||||
|
|
Loading…
Reference in New Issue