8000 bpo-39885: IDLE: Leave selection when right click within by terryjreedy · Pull Request #18951 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-39885: IDLE: Leave selection when right click within #18951

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 29, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'origin/master' into rclick
# Conflicts:
#	Misc/NEWS.d/next/IDLE/2020-03-08-14-27-36.bpo-39885.29ERiR.rst
  • Loading branch information
terryjreedy committed Mar 31, 2020
commit c7a411a369382e578949229496ac43508084c8c0
33 changes: 33 additions & 0 deletions Doc/c-api/init.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1072,6 +1072,27 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
to :c:func:`PyThreadState_Clear`.


.. c:function:: PyFrameObject* PyThreadState_GetFrame(PyThreadState *tstate)

Get the current frame of the Python thread state *tstate*. It can be
``NULL`` if no frame is currently executing.

See also :c:func:`PyEval_GetFrame`.

*tstate* must not be ``NULL``.

.. versionadded:: 3.9


.. c:function:: uint64_t PyThreadState_GetID(PyThreadState *tstate)

Get the unique thread state identifier of the Python thread state *tstate*.

*tstate* must not be ``NULL``.

.. versionadded:: 3.9


.. c:function:: PyInterpreterState* PyThreadState_GetInterpreter(PyThreadState *tstate)

Get the interpreter of the Python thread state *tstate*.
Expand All @@ -1098,6 +1119,8 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
Return the interpreter's unique ID. If there was any error in doing
so then ``-1`` is returned and an error is set.

The caller must hold the GIL.

.. versionadded:: 3.7


Expand Down Expand Up @@ -1389,6 +1412,10 @@ pointer and a void pointer argument.
This function doesn't need a current thread state to run, and it doesn't
need the global interpreter lock.

To call this function in a subinterpreter, the caller must hold the GIL.
Otherwise, the function *func* can be scheduled to be called from the wrong
interpreter.

.. warning::
This is a low-level function, only useful for very special cases.
There is no guarantee that *func* will be called as quick as
Expand All @@ -1397,6 +1424,12 @@ pointer and a void pointer argument.
function is generally **not** suitable for calling Python code from
arbitrary C threads. Instead, use the :ref:`PyGILState API<gilstate>`.

.. versionchanged:: 3.9
If this function is called in a subinterpreter, the function *func* is
now scheduled to be called from the subinterpreter, rather than being
called from the main interpreter. Each subinterpreter now has its own
list of scheduled calls.

.. versionadded:: 3.1

.. _profiling:
Expand Down
60 changes: 49 additions & 11 deletions Doc/c-api/module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -196,23 +196,47 @@ or request "multi-phase initialization" by returning the definition struct itsel
.. c:member:: traverseproc m_traverse

A traversal function to call during GC traversal of the module object, or
``NULL`` if not needed. This function may be called before module state
is allocated (:c:func:`PyModule_GetState()` may return `NULL`),
and before the :c:member:`Py_mod_exec` function is executed.
``NULL`` if not needed.

This function is not called if the module state was requested but is not
allocated yet. This is the case immediately after the module is created
and before the module is executed (:c:data:`Py_mod_exec` function). More
precisely, this function is not called if :c:member:`m_size` is greater
than 0 and the module state (as returned by :c:func:`PyModule_GetState`)
is ``NULL``.

.. versionchanged:: 3.9
No longer called before the module state is allocated.

.. c:member:: inquiry m_clear

A clear function to call during GC clearing of the module object, or
``NULL`` if not needed. This function may be called before module state
is allocated (:c:func:`PyModule_GetState()` may return `NULL`),
and before the :c:member:`Py_mod_exec` function is executed.
``NULL`` if not needed.

This function is not called if the module state was requested but is not
allocated yet. This is the case immediately after the module is created
and before the module is executed (:c:data:`Py_mod_exec` function). More
precisely, this function is not called if :c:member:`m_size` is greater
than 0 and the module state (as returned by :c:func:`PyModule_GetState`)
is ``NULL``.

.. versionchanged:: 3.9
No longer called before the module state is allocated.

.. c:member:: freefunc m_free

A function to call during deallocation of the module object, or ``NULL`` if
not needed. This function may be called before module state
is allocated (:c:func:`PyModule_GetState()` may return `NULL`),
and before the :c:member:`Py_mod_exec` function is executed.
A function to call during deallocation of the module object, or ``NULL``
if not needed.

This function is not called if the module state was requested but is not
allocated yet. This is the case immediately after the module is created
and before the module is executed (:c:data:`Py_mod_exec` function). More
precisely, this function is not called if :c:member:`m_size` is greater
than 0 and the module state (as returned by :c:func:`PyModule_GetState`)
is ``NULL``.

.. versionchanged:: 3.9
No longer called before the module state is allocated.

Single-phase initialization
...........................
Expand Down Expand Up @@ -417,7 +441,7 @@ state:

Add an object to *module* as *name*. This is a convenience function which can
be used from the module's initialization function. This steals a reference to
*value* on success. Return ``-1`` on error, ``0`` on success.
*value* on success. Return ``-1`` on error, ``0`` on success.

.. note::

Expand Down Expand Up @@ -460,6 +484,16 @@ state:

Add a string constant to *module*.

.. c:function:: int PyModule_AddType(PyObject *module, PyTypeObject *type)

Add a type object to *module*.
The type object is finalized by calling internally :c:func:`PyType_Ready`.
The name of the type object is taken from the last component of
:c:member:`~PyTypeObject.tp_name` after dot.
Return ``-1`` on error, ``0`` on success.

.. versionadded:: 3.9


Module lookup
^^^^^^^^^^^^^
Expand Down Expand Up @@ -493,6 +527,8 @@ since multiple such modules can be created from a single definition.
mechanisms (either by calling it directly, or by referring to its
implementation for details of the required state updates).

The caller must hold the GIL.

Return 0 on success or -1 on failure.

.. versionadded:: 3.3
Expand All @@ -502,4 +538,6 @@ since multiple such modules can be created from a single definition.
Removes the module object created from *def* from the interpreter state.
Return 0 on success or -1 on failure.

The caller must hold the GIL.

.. versionadded:: 3.3
2 changes: 1 addition & 1 deletion Doc/c-api/object.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ Object Protocol
.. versionadded:: 3.3


.. c:function:: int PyObject_GenericSetDict(PyObject *o, void *context)
.. c:function:: int PyObject_GenericSetDict(PyObject *o, PyObject *value, void *context)

A generic implementation for the setter of a ``__dict__`` descriptor. This
implementation does not allow the dictionary to be deleted.
Expand Down
10 changes: 6 additions & 4 deletions Doc/c-api/reflection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,31 @@
Reflection
==========

.. c:function:: PyObject* PyEval_GetBuiltins()
.. c:function:: PyObject* PyEval_GetBuiltins(void)

Return a dictionary of the builtins in the current execution frame,
or the interpreter of the thread state if no frame is currently executing.


.. c:function:: PyObject* PyEval_GetLocals()
.. c:function:: PyObject* PyEval_GetLocals(void)

Return a dictionary of the local variables in the current execution frame,
or ``NULL`` if no frame is currently executing.


.. c:function:: PyObject* PyEval_GetGlobals()
.. c:function:: PyObject* PyEval_GetGlobals(void)

Return a dictionary of the global variables in the current execution frame,
or ``NULL`` if no frame is currently executing.


.. c:function:: PyFrameObject* PyEval_GetFrame()
.. c:function:: PyFrameObject* PyEval_GetFrame(void)

Return the current thread state's frame, which is ``NULL`` if no frame is
currently executing.

See also :c:func:`PyThreadState_GetFrame`.


.. c:function:: int PyFrame_GetLineNumber(PyFrameObject *frame)

Expand Down
3 changes: 2 additions & 1 deletion Doc/data/refcounts.dat
Original file line number Diff line number Diff line change
Expand Up @@ -1673,7 +1673,8 @@ PyObject_GenericSetAttr:PyObject*:name:0:
PyObject_GenericSetAttr:PyObject*:value:+1:

PyObject_GenericSetDict:int:::
PyObject_GenericSetDict:PyObject*:o:+1:
PyObject_GenericSetDict:PyObject*:o:0:
PyObject_GenericSetDict:PyObject*:value:+1:
PyObject_GenericSetDict:void*:context::

PyObject_GetAttr:PyObject*::+1:
Expand Down
2 changes: 1 addition & 1 deletion Doc/install/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ scripts will wind up in :file:`/usr/local/python/bin`. If you want them in

python setup.py install --install-scripts=/usr/local/bin

(This performs an installation using the "prefix scheme," where the prefix is
(This performs an installation using the "prefix scheme", where the prefix is
whatever your Python interpreter was installed with--- :file:`/usr/local/python`
in this case.)

Expand Down
3 changes: 3 additions & 0 deletions Doc/library/collections.rst
F438
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ The class can be used to simulate nested scopes and is useful in templating.
>>> list(combined)
['music', 'art', 'opera']

.. versionchanged:: 3.9
Added support for ``|`` and ``|=`` operators, specified in :pep:`584`.

.. seealso::

* The `MultiContext class
Expand Down
3 changes: 2 additions & 1 deletion Doc/library/csv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ The :mod:`csv` module defines the following classes:
If a row has more fields than fieldnames, the remaining data is put in a
list and stored with the fieldname specified by *restkey* (which defaults
to ``None``). If a non-blank row has fewer fields than fieldnames, the
missing values are filled-in with ``None``.
missing values are filled-in with the value of *restval* (which defaults
to ``None``).

All other optional or keyword arguments are passed to the underlying
:class:`reader` instance.
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/dis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,7 @@ All of the following opcodes use their arguments.

TOS is an :term:`iterator`. Call its :meth:`~iterator.__next__` method. If
this yields a new value, push it on the stack (leaving the iterator below
it). If the iterator indicates it is exhausted TOS is popped, and the byte
it). If the iterator indicates it is exhausted, TOS is popped, and the byte
code counter is incremented by *delta*.


Expand Down
2 changes: 1 addition & 1 deletion Doc/library/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,7 @@ are always available. They are listed here in alphabetical order.
the second argument to be negative, permitting computation of modular
inverses.

.. versionchanged:: 3.9
.. versionchanged:: 3.8
Allow keyword arguments. Formerly, only positional arguments were
supported.

Expand Down
4 changes: 4 additions & 0 deletions Doc/library/importlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,10 @@ find and load modules.
Only class methods are defined by this class to alleviate the need for
instantiation.

.. versionchanged:: 3.4
Gained :meth:`~Loader.create_module` and :meth:`~Loader.exec_module`
methods.


.. class:: WindowsRegistryFinder

Expand Down
1 change: 1 addition & 0 deletions Doc/library/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ is the module's name in the Python package namespace.
message format string, and the *args* are the arguments which are merged into
*msg* using the string formatting operator. (Note that this means that you can
use keywords in the format string, together with a single dictionary argument.)
No % formatting operation is performed on *msg* when no *args* are supplied.

There are four keyword arguments in *kwargs* which are inspected:
*exc_info*, *stack_info*, *stacklevel* and *extra*.
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/mailcap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ belonging to a temporary file) and the :program:`xmpeg` program can be
automatically started to view the file.

The mailcap format is documented in :rfc:`1524`, "A User Agent Configuration
Mechanism For Multimedia Mail Format Information," but is not an Internet
Mechanism For Multimedia Mail Format Information", but is not an Internet
standard. However, mailcap files are supported on most Unix systems.


Expand Down
2 changes: 1 addition & 1 deletion Doc/library/pprint.rst
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ The :mod:`pprint` module also provides several shortcut functions:

.. index:: builtin: eval

Determine if the formatted representation of *object* is "readable," or can be
Determine if the formatted representation of *object* is "readable", or can be
used to reconstruct the value using :func:`eval`. This always returns ``False``
for recursive objects.

Expand Down
12 changes: 7 additions & 5 deletions Doc/library/signal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ This has consequences:
Signals and threads
^^^^^^^^^^^^^^^^^^^

Python signal handlers are always executed in the main Python thread,
Python signal handlers are always executed in the main Python thread of the main interpreter,
even if the signal was received in another thread. This means that signals
can't be used as a means of inter-thread communication. You can use
the synchronization primitives from the :mod:`threading` module instead.

Besides, only the main thread is allowed to set a new signal handler.
Besides, only the main thread of the main interpreter is allowed to set a new signal handler.


Module contents
Expand Down Expand Up @@ -266,7 +266,7 @@ The :mod:`signal` module defines the following functions:
same process as the caller. The target thread can be executing any code
(Python or not). However, if the target thread is executing the Python
interpreter, the Python signal handlers will be :ref:`executed by the main
thread <signals-and-threads>`. Therefore, the only point of sending a
thread of the main interpreter <signals-and-threads>`. Therefore, the only point of sending a
signal to a particular Python thread would be to force a running system call
to fail with :exc:`InterruptedError`.

Expand Down Expand Up @@ -360,7 +360,8 @@ The :mod:`signal` module defines the following functions:
If not -1, *fd* must be non-blocking. It is up to the library to remove
any bytes from *fd* before calling poll or select again.

When threads are enabled, this function can only be called from the main thread;
When threads are enabled, this function can only be called
from :ref:`the main thread of the main interpreter <signals-and-threads>`;
attempting to call it from other threads will cause a :exc:`ValueError`
exception to be raised.

Expand Down Expand Up @@ -413,7 +414,8 @@ The :mod:`signal` module defines the following functions:
signal handler will be returned (see the description of :func:`getsignal`
above). (See the Unix man page :manpage:`signal(2)` for further information.)

When threads are enabled, this function can only be called from the main thread;
When threads are enabled, this function can only be called
from :ref:`the main thread of the main interpreter <signals-and-threads>`;
attempting to call it from other threads will cause a :exc:`ValueError`
exception to be raised.

Expand Down
2 changes: 2 additions & 0 deletions Doc/library/socketserver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ Server Objects
.. method:: shutdown()

Tell the :meth:`serve_forever` loop to stop and wait until it does.
:meth:`shutdown` must be called while :meth:`serve_forever` is running in a
different thread otherwise it will deadlock.


.. method:: server_close()
Expand Down
7 changes: 4 additions & 3 deletions Doc/library/sqlite3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,10 @@ Module functions and constants
that 'mytype' is the type of the column. It will try to find an entry of
'mytype' in the converters dictionary and then use the converter function found
there to return the value. The column name found in :attr:`Cursor.description`
is only the first word of the column name, i. e. if you use something like
``'as "x [datetime]"'`` in your SQL, then we will parse out everything until the
first blank for the column name: the column name would simply be "x".
does not include the type, i. e. if you use something like
``'as "Expiration date [datetime]"'`` in your SQL, then we will parse out
everything until the first ``'['`` for the column name and strip
the preceeding space: the column name would simply be "Expiration date".


.. function:: connect(database[, timeout, detect_types, isolation_level, check_same_thread, factory, cached_statements, uri])
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/ssl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ This module provides a class, :class:`ssl.SSLSocket`, which is derived from the
:class:`socket.socket` type, and provides a socket-like wrapper that also
encrypts and decrypts the data going over the socket with SSL. It supports
additional methods such as :meth:`getpeercert`, which retrieves the
certificate of the other side of the connection, and :meth:`cipher`,which
certificate of the other side of the connection, and :meth:`cipher`, which
retrieves the cipher being used for the secure connection.

For more sophisticated applications, the :class:`ssl.SSLContext` class
Expand Down Expand Up @@ -2271,7 +2271,7 @@ Visual inspection shows that the certificate does identify the desired service
(('postalCode', '03894-4801'),),
(('countryName', 'US'),),
(('stateOrProvinceName', 'NH'),),
(('localityName', 'Wolfeboro,'),),
(('localityName', 'Wolfeboro'),),
(('organizationName', 'Python Software Foundation'),),
(('commonName', 'www.python.org'),)),
'subjectAltName': (('DNS', 'www.python.org'),
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/textwrap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ hyphenated words; only then will long words be broken if necessary, unless
:attr:`fix_sentence_endings` is false by default.

Since the sentence detection algorithm relies on ``string.lowercase`` for
the definition of "lowercase letter," and a convention of using two spaces
the definition of "lowercase letter", and a convention of using two spaces
after a period to separate sentences on the same line, it is specific to
English-language texts.

Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.
0