Skip to content

bpo-33311: Do not display parameters displayed in parentheses for module call #6522

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

Closed
wants to merge 45 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
29713de
Parameters displayed in parentheses are not displayed for module call
sblondon Apr 13, 2018
590ce5b
add news file
sblondon Apr 18, 2018
e5362ea
bpo-33308: Fix a crash in the parser module when convert an ST object…
serhiy-storchaka Apr 18, 2018
e3a523a
bpo-31583: Fix 2to3 for using with --add-suffix option (GH-3758)
denis-osipov Apr 18, 2018
9009f3e
Update What's new in 3.7 to reference preadv, pwritev and posix_spawn…
pablogsal Apr 19, 2018
b7e1eff
bpo-33299: Return an object itself for some types in _PyCode_Constant…
serhiy-storchaka Apr 19, 2018
6952482
bpo-33189: pygettext.py now accepts only literal strings (GH-6364)
serhiy-storchaka Apr 19, 2018
b87c1c9
Clean up the readme text around PGO a bit. (GH-6538)
gpshead Apr 19, 2018
397f1b2
bpo-33312: Fix clang ubsan out of bounds warnings in dict. (GH-6537)
gpshead Apr 20, 2018
d70c2a6
bpo-33298: Wrap only constants with _PyCode_ConstantKey() in the comp…
serhiy-storchaka Apr 20, 2018
063db62
bpo-32232: by default, Setup modules are no longer built with -DPy_BU…
xdegaye Apr 20, 2018
53f67d4
bpo-33312: update Tools/gdb/libpython.py to match. (GH-6548)
gpshead Apr 20, 2018
0399cf9
bpo-33131: Upgrade ensurepip to bundle pip 10.0.1 (GH-6546)
pfmoore Apr 20, 2018
61f82e0
Spelling fixes to docs, docstrings, and comments (GH-6374)
scop Apr 20, 2018
a8c3424
bpo-25427: Remove pyvenv (GH-5962)
brettcannon Apr 20, 2018
441d945
Clarify that __path__ can't be just any value (GH-6554)
brettcannon Apr 20, 2018
b81ca28
bpo-33297: Mention Pillow to work with more image formats. (#6505)
andresdelfino Apr 21, 2018
d5a2377
bpo-991266: Fix quoting of Comment attribute of SimpleCookie (GH-6555)
berkerpeksag Apr 22, 2018
c2d384d
bpo-33338: [tokenize] Minor code cleanup (#6573)
ambv Apr 23, 2018
25038ec
bpo-33329: Fix multiprocessing regression on newer glibcs (GH-6575)
pitrou Apr 23, 2018
1d4a733
bpo-33251: Prevent ConfigParser.items returning items present in vars…
chrBrd Apr 23, 2018
e500839
bpo-33251: Update documentation to reflect change. (GH-6446) (#6583)
chrBrd Apr 23, 2018
650ba4f
acks += chrBrd (#6584)
ambv Apr 23, 2018
0977091
bpo-33128 Fix duplicated call to importlib._install_external_importer…
pablogsal Apr 25, 2018
d6ef6db
Fix rendering issues in the documentation for the os module (#6525)
pablogsal Apr 25, 2018
643ff71
Mention both relevant PEPs in function annotations tutorial (GH-6304)
neerajbadlani Apr 25, 2018
67a8f4f
bpo-33280: Reorganize external Tcl/Tk references. (GH-6473)
andresdelfino Apr 25, 2018
e9d9494
bpo-33330: Improve error handling in PyImport_Cleanup(). (GH-6564)
serhiy-storchaka Apr 25, 2018
57faf34
bpo-33334: Support NOP and EXTENDED_ARG in dis.stack_effect(). (#6566)
serhiy-storchaka Apr 25, 2018
0250de4
bpo-27485: Rename and deprecate undocumented functions in urllib.pars…
csabella Apr 25, 2018
df826f3
Clarify the inspect.getmembers predicate parameter (#6615)
briancurtin Apr 26, 2018
4114846
bpo-33358: Fix test_embed.test_pre_initialization_sys_options (GH-6612)
pablogsal Apr 27, 2018
078c4e3
bpo-33041: Fix downcast warning on Windows (#6595)
vstinner Apr 27, 2018
e239650
bpo-33363: raise SyntaxError for async for/with outside async functio…
zsol Apr 27, 2018
e022bbc
Change "non-local state" to "content-local state". (GH-6617)
tomchristie Apr 27, 2018
5779483
bpo-33378: Add Korean to the language switcher. (GH-6627)
corona10 Apr 28, 2018
2e38cc3
bpo-33383: Fix crash in get() of the dbm.ndbm database object. (#6630)
serhiy-storchaka Apr 29, 2018
70af06c
bpo-31026: Fix test_dbm if dbm.ndbm is build with Berkeley DB. (GH-6632)
serhiy-storchaka Apr 29, 2018
7d68bfa
bpo-33256: Replace angle brackets around python object repr to displa…
sblondon Apr 29, 2018
9f3535c
bpo-32362: Fix references to non-existent multiprocessing.Connection(…
bbayles Apr 29, 2018
55edd0c
bpo-33012: Fix invalid function cast warnings with gcc 8 for METH_NOA…
siddhesh Apr 29, 2018
c1a6832
bpo-33330: Write exceptions occurred in PyImport_Cleanup() to stderr.…
serhiy-storchaka Apr 29, 2018
88330c7
Parameters displayed in parentheses are not displayed for module call
sblondon Apr 13, 2018
a6407a5
add news file
sblondon Apr 18, 2018
feadd60
merge master into no-parentheses-for-module-call branch
sblondon Apr 30, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Doc/distutils/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ modules using the Distutils:
module distribution
a collection of Python modules distributed together as a single downloadable
resource and meant to be installed *en masse*. Examples of some well-known
module distributions are NumPy, SciPy, PIL (the Python Imaging
Library), or mxBase. (This would be called a *package*, except that term is
module distributions are NumPy, SciPy, Pillow,
or mxBase. (This would be called a *package*, except that term is
already taken in the Python context: a single module distribution may contain
zero, one, or many Python packages.)

Expand Down
2 changes: 1 addition & 1 deletion Doc/extending/newtypes_tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ We define a single method, :meth:`Custom.name()`, that outputs the objects name
concatenation of the first and last names. ::

static PyObject *
Custom_name(CustomObject *self)
Custom_name(CustomObject *self, PyObject *Py_UNUSED(ignored))
{
if (self->first == NULL) {
PyErr_SetString(PyExc_AttributeError, "first");
Expand Down
5 changes: 0 additions & 5 deletions Doc/installing/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,6 @@ Key terms
of the mailing list used to coordinate Python packaging standards
development).

.. deprecated:: 3.6
``pyvenv`` was the recommended tool for creating virtual environments for
Python 3.3 and 3.4, and is `deprecated in Python 3.6
<https://docs.python.org/dev/whatsnew/3.6.html#deprecated-features>`_.

.. versionchanged:: 3.5
The use of ``venv`` is now recommended for creating virtual environments.

Expand Down
5 changes: 5 additions & 0 deletions Doc/library/configparser.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,11 @@ ConfigParser Objects
given *section*. Optional arguments have the same meaning as for the
:meth:`get` method.

.. versionchanged:: 3.8
Items present in *vars* no longer appear in the result. The previous
behaviour mixed actual parser options with variables provided for
interpolation.


.. method:: set(section, option, value)

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/contextvars.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

--------------

This module provides APIs to manage, store, and access non-local
This module provides APIs to manage, store, and access context-local
state. The :class:`~contextvars.ContextVar` class is used to declare
and work with *Context Variables*. The :func:`~contextvars.copy_context`
function and the :class:`~contextvars.Context` class should be used to
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/email.generator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ to be using :class:`BytesGenerator`, and not :class:`Generator`.
Convert any bytes with the high bit set as needed using an
ASCII-compatible :mailheader:`Content-Transfer-Encoding`. That is,
transform parts with non-ASCII :mailheader:`Cotnent-Transfer-Encoding`
(:mailheader:`Content-Transfer-Encoding: 8bit`) to an ASCII compatibile
(:mailheader:`Content-Transfer-Encoding: 8bit`) to an ASCII compatible
:mailheader:`Content-Transfer-Encoding`, and encode RFC-invalid non-ASCII
bytes in headers using the MIME ``unknown-8bit`` character set, thus
rendering them RFC-compliant.
Expand Down
7 changes: 4 additions & 3 deletions Doc/library/inspect.rst
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,10 @@ attributes:

.. function:: getmembers(object[, predicate])

Return all the members of an object in a list of (name, value) pairs sorted by
name. If the optional *predicate* argument is supplied, only members for which
the predicate returns a true value are included.
Return all the members of an object in a list of ``(name, value)``
pairs sorted by name. If the optional *predicate* argument—which will be
called with the ``value`` object of each member—is supplied, only members
for which the predicate returns a true value are included.

.. note::

Expand Down
28 changes: 17 additions & 11 deletions Doc/library/multiprocessing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -735,8 +735,9 @@ For an example of the usage of queues for interprocess communication see

.. function:: Pipe([duplex])

Returns a pair ``(conn1, conn2)`` of :class:`Connection` objects representing
the ends of a pipe.
Returns a pair ``(conn1, conn2)`` of
:class:`~multiprocessing.connection.Connection` objects representing the
ends of a pipe.

If *duplex* is ``True`` (the default) then the pipe is bidirectional. If
*duplex* is ``False`` then the pipe is unidirectional: ``conn1`` can only be
Expand Down Expand Up @@ -1021,10 +1022,13 @@ Miscellaneous
Connection Objects
~~~~~~~~~~~~~~~~~~

.. currentmodule:: multiprocessing.connection

Connection objects allow the sending and receiving of picklable objects or
strings. They can be thought of as message oriented connected sockets.

Connection objects are usually created using :func:`Pipe` -- see also
Connection objects are usually created using
:func:`Pipe <multiprocessing.Pipe>` -- see also
:ref:`multiprocessing-listeners-clients`.

.. class:: Connection
Expand Down Expand Up @@ -1159,6 +1163,8 @@ For example:
Synchronization primitives
~~~~~~~~~~~~~~~~~~~~~~~~~~

.. currentmodule:: multiprocessing

Generally synchronization primitives are not as necessary in a multiprocess
program as they are in a multithreaded program. See the documentation for
:mod:`threading` module.
Expand Down Expand Up @@ -2269,7 +2275,7 @@ Listeners and Clients
:synopsis: API for dealing with sockets.

Usually message passing between processes is done using queues or by using
:class:`~multiprocessing.Connection` objects returned by
:class:`~Connection` objects returned by
:func:`~multiprocessing.Pipe`.

However, the :mod:`multiprocessing.connection` module allows some extra
Expand Down Expand Up @@ -2299,7 +2305,7 @@ multiple connections at the same time.
.. function:: Client(address[, family[, authkey]])

Attempt to set up a connection to the listener which is using address
*address*, returning a :class:`~multiprocessing.Connection`.
*address*, returning a :class:`~Connection`.

The type of the connection is determined by *family* argument, but this can
generally be omitted since it can usually be inferred from the format of
Expand Down Expand Up @@ -2349,8 +2355,8 @@ multiple connections at the same time.
.. method:: accept()

Accept a connection on the bound socket or named pipe of the listener
object and return a :class:`~multiprocessing.Connection` object. If
authentication is attempted and fails, then
object and return a :class:`~Connection` object.
If authentication is attempted and fails, then
:exc:`~multiprocessing.AuthenticationError` is raised.

.. method:: close()
Expand Down Expand Up @@ -2386,7 +2392,7 @@ multiple connections at the same time.
For both Unix and Windows, an object can appear in *object_list* if
it is

* a readable :class:`~multiprocessing.Connection` object;
* a readable :class:`~multiprocessing.connection.Connection` object;
* a connected and readable :class:`socket.socket` object; or
* the :attr:`~multiprocessing.Process.sentinel` attribute of a
:class:`~multiprocessing.Process` object.
Expand Down Expand Up @@ -2509,10 +2515,10 @@ an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'`` address.
Authentication keys
~~~~~~~~~~~~~~~~~~~

When one uses :meth:`Connection.recv <multiprocessing.Connection.recv>`, the
When one uses :meth:`Connection.recv <Connection.recv>`, the
data received is automatically
unpickled. Unfortunately unpickling data from an untrusted source is a security
risk. Therefore :class:`Listener` and :func:`Client` use the :mod:`hmac` module
unpickled. Unfortunately unpickling data from an untrusted source is a security
risk. Therefore :class:`Listener` and :func:`Client` use the :mod:`hmac` module
to provide digest authentication.

An authentication key is a byte string which can be thought of as a
Expand Down
20 changes: 16 additions & 4 deletions Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1126,18 +1126,24 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo

.. versionadded:: 3.7

.. data:: RWF_DSYNC (since Linux 4.7)
.. data:: RWF_DSYNC

Provide a per-write equivalent of the O_DSYNC open(2) flag. This flag
is meaningful only for pwritev2(), and its effect applies only to the
data range written by the system call.

Availability: Linux (version 4.7).

.. versionadded:: 3.7

.. data:: RWF_SYNC (since Linux 4.7)
.. data:: RWF_SYNC

Provide a per-write equivalent of the O_SYNC open(2) flag. This flag is
meaningful only for pwritev2(), and its effect applies only to the data
range written by the system call.

Availability: Linux (version 4.7).

.. versionadded:: 3.7


Expand Down Expand Up @@ -1260,23 +1266,29 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo
.. versionadded:: 3.7


.. data:: RWF_HIPRI (since Linux 4.6)
.. data:: RWF_HIPRI

High priority read/write. Allows block-based filesystems to use polling
of the device, which provides lower latency, but may use additional
resources. (Currently, this feature is usable only on a file descriptor
opened using the O_DIRECT flag.)

Availability: Linux (version 4.6).

.. versionadded:: 3.7


.. data:: RWF_NOWAIT (since Linux 4.14)
.. data:: RWF_NOWAIT

Do not wait for data which is not immediately available. If this flag
is specified, the preadv2() system call will return instantly
if it would have to read data from the backing storage or wait for a lock.
If some data was successfully read, it will return the number of bytes
read. If no bytes were read, it will return -1 and set errno to EAGAIN.
Currently, this flag is meaningful only for preadv2().

Availability: Linux (version 4.14).

.. versionadded:: 3.7


Expand Down
2 changes: 1 addition & 1 deletion Doc/library/test.rst
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ The :mod:`test.support` module defines the following functions:

.. function:: wait_threads_exit(timeout=60.0)

Context manager to wait until all threads created in the ``with`` statment
Context manager to wait until all threads created in the ``with`` statement
exit.


Expand Down
53 changes: 31 additions & 22 deletions Doc/library/tkinter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@
The :mod:`tkinter` package ("Tk interface") is the standard Python interface to
the Tk GUI toolkit. Both Tk and :mod:`tkinter` are available on most Unix
platforms, as well as on Windows systems. (Tk itself is not part of Python; it
is maintained at ActiveState.) You can check that :mod:`tkinter` is properly
installed on your system by running ``python -m tkinter`` from the command line;
this should open a window demonstrating a simple Tk interface.
is maintained at ActiveState.)

Running ``python -m tkinter`` from the command line should open a window
demonstrating a simple Tk interface, letting you know that :mod:`tkinter` is
properly installed on your system, and also showing what version of Tcl/Tk is
installed, so you can read the Tcl/Tk documentation specific to that version.

.. seealso::

Tkinter documentation:

`Python Tkinter Resources <https://wiki.python.org/moin/TkInter>`_
The Python Tkinter Topic Guide provides a great deal of information on using Tk
from Python and links to other sources of information on Tk.
Expand All @@ -32,17 +37,32 @@ this should open a window demonstrating a simple Tk interface.
`Tkinter docs from effbot <http://effbot.org/tkinterbook/>`_
Online reference for tkinter supported by effbot.org.

`Tcl/Tk manual <https://www.tcl.tk/man/tcl8.5/>`_
Official manual for the latest tcl/tk version.

`Programming Python <http://learning-python.com/about-pp4e.html>`_
Book by Mark Lutz, has excellent coverage of Tkinter.

`Modern Tkinter for Busy Python Developers <https://www.amazon.com/Modern-Tkinter-Python-Developers-ebook/dp/B0071QDNLO/>`_
Book by Mark Rozerman about building attractive and modern graphical user interfaces with Python and Tkinter.

`Python and Tkinter Programming <https://www.manning.com/books/python-and-tkinter-programming>`_
The book by John Grayson (ISBN 1-884777-81-3).
Book by John Grayson (ISBN 1-884777-81-3).

Tcl/Tk documentation:

`Tk commands <https://www.tcl.tk/man/tcl8.6/TkCmd/contents.htm>`_
Most commands are available as :mod:`tkinter` or :mod:`tkinter.ttk` classes.
Change '8.6' to match the version of your Tcl/Tk installation.

`Tcl/Tk recent man pages <https://www.tcl.tk/doc/>`_
Recent Tcl/Tk manuals on www.tcl.tk.

`ActiveState Tcl Home Page <http://tcl.activestate.com/>`_
The Tk/Tcl development is largely taking place at ActiveState.

`Tcl and the Tk Toolkit <https://www.amazon.com/exec/obidos/ASIN/020163337X>`_
Book by John Ousterhout, the inventor of Tcl.

`Practical Programming in Tcl and Tk <http://www.beedub.com/book/>`_
Brent Welch's encyclopedic book.


Tkinter Modules
Expand Down Expand Up @@ -175,21 +195,6 @@ documentation that exists. Here are some hints:
place to go when nothing else makes sense.


.. seealso::

`Tcl/Tk 8.6 man pages <https://www.tcl.tk/man/tcl8.6/>`_
The Tcl/Tk manual on www.tcl.tk.

`ActiveState Tcl Home Page <http://tcl.activestate.com/>`_
The Tk/Tcl development is largely taking place at ActiveState.

`Tcl and the Tk Toolkit <https://www.amazon.com/exec/obidos/ASIN/020163337X>`_
The book by John Ousterhout, the inventor of Tcl.

`Practical Programming in Tcl and Tk <http://www.beedub.com/book/>`_
Brent Welch's encyclopedic book.


A Simple Hello World Program
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -800,6 +805,10 @@ reference to the image. When the last Python reference to the image object is
deleted, the image data is deleted as well, and Tk will display an empty box
wherever the image was used.

.. seealso::

The `Pillow <http://python-pillow.org/>`_ package adds support for
formats such as BMP, JPEG, TIFF, and WebP, among others.

.. _tkinter-file-handlers:

Expand Down
4 changes: 0 additions & 4 deletions Doc/library/venv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ independent set of installed Python packages in its site directories.

See :pep:`405` for more information about Python virtual environments.

.. note::
The ``pyvenv`` script has been deprecated as of Python 3.6 in favor of using
``python3 -m venv`` to help prevent any potential confusion as to which
Python interpreter a virtual environment will be based on.


Creating virtual environments
Expand Down
3 changes: 1 addition & 2 deletions Doc/reference/import.rst
Original file line number Diff line number Diff line change
Expand Up @@ -616,8 +616,7 @@ the module.
module.__path__
---------------

By definition, if a module has a ``__path__`` attribute, it is a package,
regardless of its value.
By definition, if a module has a ``__path__`` attribute, it is a package.

A package's ``__path__`` attribute is used during imports of its subpackages.
Within the import machinery, it functions much the same as :data:`sys.path`,
Expand Down
1 change: 1 addition & 0 deletions Doc/tools/static/switchers.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
'en': 'English',
'fr': 'French',
'ja': 'Japanese',
'ko': 'Korean',
};

function build_version_select(current_version, current_release) {
Expand Down
4 changes: 2 additions & 2 deletions Doc/tutorial/controlflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -678,8 +678,8 @@ Function Annotations
single: -> (return annotation assignment)

:ref:`Function annotations <function>` are completely optional metadata
information about the types used by user-defined functions (see :pep:`484`
for more information).
information about the types used by user-defined functions (see :pep:`3107` and
:pep:`484` for more information).

Annotations are stored in the :attr:`__annotations__` attribute of the function
as a dictionary and have no effect on any other part of the function. Parameter
Expand Down
2 changes: 1 addition & 1 deletion Doc/tutorial/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ module names". For example, the module name :mod:`A.B` designates a submodule
named ``B`` in a package named ``A``. Just like the use of modules saves the
authors of different modules from having to worry about each other's global
variable names, the use of dotted module names saves the authors of multi-module
packages like NumPy or the Python Imaging Library from having to worry about
packages like NumPy or Pillow from having to worry about
each other's module names.

Suppose you want to design a collection of modules (a "package") for the uniform
Expand Down
8 changes: 8 additions & 0 deletions Doc/whatsnew/3.7.rst
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,14 @@ New function :func:`~os.register_at_fork` allows registering Python callbacks
to be executed on a process fork. (Contributed by Antoine Pitrou in
:issue:`16500`.)

Exposed the system calls *preadv*, *preadv2*, *pwritev* and *pwritev2* through
the new functions :func:`~os.preadv` and :func:`~os.pwritev`. (Contributed by
Pablo Galindo in :issue:`31368`.)

Exposed the system call *posix_spawn* through the new function
:func:`~os.posix_spawn`. (Contributed by Pablo Galindo, Serhiy Storchaka and
Gregory P. Smith in :issue:`20104`.)

pdb
---

Expand Down
3 changes: 3 additions & 0 deletions Doc/whatsnew/3.8.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ Deprecated
Removed
=======

* The ``pyvenv`` script has been removed in favor of ``python3.8 -m venv``
to help eliminate confusion as to what Python interpreter the ``pyvenv``
script is tied to. (Contributed by Brett Cannon in :issue:`25427`.)


Porting to Python 3.8
Expand Down
Loading