Skip to content
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 branch 'main' into privatize-smtpd
  • Loading branch information
arhadthedev committed Aug 4, 2022
commit 7423617444538c4fb2623c6529fa037fbfce828a
4 changes: 2 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ Lib/test/cjkencodings/* noeol
Lib/test/coding20731.py noeol
Lib/test/decimaltestdata/*.decTest noeol
Lib/test/test_email/data/*.txt noeol
Lib/test/test_importlib/data01/* noeol
Lib/test/test_importlib/namespacedata01/* noeol
Lib/test/test_importlib/resources/data01/* noeol
Lib/test/test_importlib/resources/namespacedata01/* noeol
Lib/test/xmltestdata/* noeol

# CRLF files
Expand Down
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Python/pythonrun.c @iritkatriel
# bytecode.
**/*import*.c @brettcannon @encukou @ericsnowcurrently @ncoghlan @warsaw
**/*import*.py @brettcannon @encukou @ericsnowcurrently @ncoghlan @warsaw
**/importlib/resources/* @jaraco @warsaw @brettcannon
**/*importlib/resources/* @jaraco @warsaw @brettcannon
**/importlib/metadata/* @jaraco @warsaw

# Dates and times
Expand Down
8 changes: 4 additions & 4 deletions .github/CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ Build Status

- main

+ `Stable buildbots <http://buildbot.python.org/3.x.stable/>`_
+ `Stable buildbots <https://buildbot.python.org/3.x.stable/>`_

- 3.9

+ `Stable buildbots <http://buildbot.python.org/3.9.stable/>`_
+ `Stable buildbots <https://buildbot.python.org/3.9.stable/>`_

- 3.8

+ `Stable buildbots <http://buildbot.python.org/3.8.stable/>`_
+ `Stable buildbots <https://buildbot.python.org/3.8.stable/>`_

- 3.7

+ `Stable buildbots <http://buildbot.python.org/3.7.stable/>`_
+ `Stable buildbots <https://buildbot.python.org/3.7.stable/>`_


Thank You
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ jobs:
run: make -C Doc/ PYTHON=../python venv
# Use "xvfb-run" since some doctest tests open GUI windows
- name: 'Run documentation doctest'
run: xvfb-run make -C Doc/ PYTHON=../python SPHINXOPTS="-q" SPHINXERRORHANDLING="-W --keep-going" doctest
run: xvfb-run make -C Doc/ PYTHON=../python SPHINXERRORHANDLING="-W --keep-going" doctest
4 changes: 2 additions & 2 deletions Doc/about.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ About these documents
These documents are generated from `reStructuredText`_ sources by `Sphinx`_, a
document processor specifically written for the Python documentation.

.. _reStructuredText: http://docutils.sourceforge.net/rst.html
.. _reStructuredText: https://docutils.sourceforge.io/rst.html
.. _Sphinx: http://sphinx-doc.org/

.. In the online version of these documents, you can submit comments and suggest
Expand All @@ -21,7 +21,7 @@ Many thanks go to:

* Fred L. Drake, Jr., the creator of the original Python documentation toolset
and writer of much of the content;
* the `Docutils <http://docutils.sourceforge.net/>`_ project for creating
* the `Docutils <https://docutils.sourceforge.io/>`_ project for creating
reStructuredText and the Docutils suite;
* Fredrik Lundh for his Alternative Python Reference project from which Sphinx
got many good ideas.
Expand Down
9 changes: 9 additions & 0 deletions Doc/c-api/call.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ This bears repeating:
A class supporting vectorcall **must** also implement
:c:member:`~PyTypeObject.tp_call` with the same semantics.

.. versionchanged:: 3.12

The :const:`Py_TPFLAGS_HAVE_VECTORCALL` flag is now removed from a class
when the class's :py:meth:`~object.__call__` method is reassigned.
(This internally sets :c:member:`~PyTypeObject.tp_call` only, and thus
may make it behave differently than the vectorcall function.)
In earlier Python versions, vectorcall should only be used with
:const:`immutable <Py_TPFLAGS_IMMUTABLETYPE>` or static types.

A class should not implement vectorcall if that would be slower
than *tp_call*. For example, if the callee needs to convert
the arguments to an args tuple and kwargs dict anyway, then there is no point
Expand Down
25 changes: 25 additions & 0 deletions Doc/c-api/code.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,28 @@ bound into a function.

.. versionadded:: 3.11

.. c:function:: PyObject* PyCode_GetVarnames(PyCodeObject *co)

Equivalent to the Python code ``getattr(co, 'co_varnames')``.
Returns a new reference to a :c:type:`PyTupleObject` containing the names of
the local variables. On error, ``NULL`` is returned and an exception
is raised.

.. versionadded:: 3.11

.. c:function:: PyObject* PyCode_GetCellvars(PyCodeObject *co)

Equivalent to the Python code ``getattr(co, 'co_cellvars')``.
Returns a new reference to a :c:type:`PyTupleObject` containing the names of
the local variables that are referenced by nested functions. On error, ``NULL``
is returned and an exception is raised.

.. versionadded:: 3.11

.. c:function:: PyObject* PyCode_GetFreevars(PyCodeObject *co)

Equivalent to the Python code ``getattr(co, 'co_freevars')``.
Returns a new reference to a :c:type:`PyTupleObject` containing the names of
the free variables. On error, ``NULL`` is returned and an exception is raised.

.. versionadded:: 3.11
17 changes: 9 additions & 8 deletions Doc/c-api/long.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,15 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
.. c:function:: PyObject* PyLong_FromString(const char *str, char **pend, int base)

Return a new :c:type:`PyLongObject` based on the string value in *str*, which
is interpreted according to the radix in *base*. If *pend* is non-``NULL``,
*\*pend* will point to the first character in *str* which follows the
representation of the number. If *base* is ``0``, *str* is interpreted using
the :ref:`integers` definition; in this case, leading zeros in a
non-zero decimal number raises a :exc:`ValueError`. If *base* is not ``0``,
it must be between ``2`` and ``36``, inclusive. Leading spaces and single
underscores after a base specifier and between digits are ignored. If there
are no digits, :exc:`ValueError` will be raised.
is interpreted according to the radix in *base*, or ``NULL`` on failure. If
*pend* is non-``NULL``, *\*pend* will point to the end of *str* on success or
to the first character that could not be processed on error. If *base* is ``0``,
*str* is interpreted using the :ref:`integers` definition; in this case, leading
zeros in a non-zero decimal number raises a :exc:`ValueError`. If *base* is not
``0``, it must be between ``2`` and ``36``, inclusive. Leading and trailing
whitespace and single underscores after a base specifier and between digits are
ignored. If there are no digits or *str* is not NULL-terminated following the
digits and trailing whitespace, :exc:`ValueError` will be raised.


.. c:function:: PyObject* PyLong_FromUnicodeObject(PyObject *u, int base)
Expand Down
41 changes: 27 additions & 14 deletions Doc/c-api/typeobj.rst
Original file line number Diff line number Diff line change
Expand Up @@ -720,29 +720,29 @@ and :c:type:`PyType_Type` effectively act as defaults.)
with the *vectorcallfunc* function.
This can be done by setting *tp_call* to :c:func:`PyVectorcall_Call`.

.. warning::

It is not recommended for :ref:`mutable heap types <heap-types>` to implement
the vectorcall protocol.
When a user sets :attr:`__call__` in Python code, only *tp_call* is updated,
likely making it inconsistent with the vectorcall function.

.. versionchanged:: 3.8

Before version 3.8, this slot was named ``tp_print``.
In Python 2.x, it was used for printing to a file.
In Python 3.0 to 3.7, it was unused.

.. versionchanged:: 3.12

Before version 3.12, it was not recommended for
:ref:`mutable heap types <heap-types>` to implement the vectorcall
protocol.
When a user sets :attr:`~type.__call__` in Python code, only *tp_call* is
updated, likely making it inconsistent with the vectorcall function.
Since 3.12, setting ``__call__`` will disable vectorcall optimization
by clearing the :const:`Py_TPFLAGS_HAVE_VECTORCALL` flag.

**Inheritance:**

This field is always inherited.
However, the :const:`Py_TPFLAGS_HAVE_VECTORCALL` flag is not
always inherited. If it's not, then the subclass won't use
always inherited. If it's not set, then the subclass won't use
:ref:`vectorcall <vectorcall>`, except when
:c:func:`PyVectorcall_Call` is explicitly called.
This is in particular the case for types without the
:const:`Py_TPFLAGS_IMMUTABLETYPE` flag set (including subclasses defined in
Python).


.. c:member:: getattrfunc PyTypeObject.tp_getattr
Expand Down Expand Up @@ -1178,12 +1178,18 @@ and :c:type:`PyType_Type` effectively act as defaults.)

**Inheritance:**

This bit is inherited for types with the
:const:`Py_TPFLAGS_IMMUTABLETYPE` flag set, if
:c:member:`~PyTypeObject.tp_call` is also inherited.
This bit is inherited if :c:member:`~PyTypeObject.tp_call` is also
inherited.

.. versionadded:: 3.9

.. versionchanged:: 3.12

This flag is now removed from a class when the class's
:py:meth:`~object.__call__` method is reassigned.

This flag can now be inherited by mutable classes.

.. data:: Py_TPFLAGS_IMMUTABLETYPE

This bit is set for type objects that are immutable: type attributes cannot be set nor deleted.
Expand Down Expand Up @@ -1942,6 +1948,13 @@ and :c:type:`PyType_Type` effectively act as defaults.)
Weak reference list head, for weak references to this type object. Not
inherited. Internal use only.

.. versionchanged:: 3.12

Internals detail: For the static builtin types this is always ``NULL``,
even if weakrefs are added. Instead, the weakrefs for each are stored
on ``PyInterpreterState``. Use the public C-API or the internal
``_PyObject_GET_WEAKREFS_LISTPTR()`` macro to avoid the distinction.

**Inheritance:**

This field is not inherited.
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/unicode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ wchar_t Support
most C functions. If *size* is ``NULL`` and the :c:type:`wchar_t*` string
contains null characters a :exc:`ValueError` is raised.

Returns a buffer allocated by :c:func:`PyMem_Alloc` (use
Returns a buffer allocated by :c:func:`PyMem_New` (use
:c:func:`PyMem_Free` to free it) on success. On error, returns ``NULL``
and *\*size* is undefined. Raises a :exc:`MemoryError` if memory allocation
is failed.
Expand Down
12 changes: 12 additions & 0 deletions Doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
import _tkinter
except ImportError:
_tkinter = None
# Treat warnings as errors, done here to prevent warnings in Sphinx code from
# causing spurious test failures.
import warnings
warnings.simplefilter('error')
del warnings
'''

manpages_url = 'https://manpages.debian.org/{path}'
Expand Down Expand Up @@ -74,6 +79,13 @@
'root_include_title': False # We use the version switcher instead.
}

# Override stylesheet fingerprinting for Windows CHM htmlhelp to fix GH-91207
# https://github.com/python/cpython/issues/91207
if any('htmlhelp' in arg for arg in sys.argv):
html_style = 'pydoctheme.css'
print("\nWARNING: Windows CHM Help is no longer supported.")
print("It may be removed in the future\n")

# Short title used e.g. for <title> HTML tags.
html_short_title = '%s Documentation' % release

Expand Down
1 change: 0 additions & 1 deletion Doc/contents.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@
.. toctree::
:hidden:

distutils/index.rst
install/index.rst
12 changes: 6 additions & 6 deletions Doc/distributing/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,21 @@ Key terms
file format standards. They maintain a variety of tools, documentation
and issue trackers on both `GitHub <https://github.com/pypa>`__ and
`Bitbucket <https://bitbucket.org/pypa/>`__.
* :mod:`distutils` is the original build and distribution system first added
to the Python standard library in 1998. While direct use of :mod:`distutils`
* ``distutils`` is the original build and distribution system first added
to the Python standard library in 1998. While direct use of ``distutils``
is being phased out, it still laid the foundation for the current packaging
and distribution infrastructure, and it not only remains part of the
standard library, but its name lives on in other ways (such as the name
of the mailing list used to coordinate Python packaging standards
development).
* `setuptools`_ is a (largely) drop-in replacement for :mod:`distutils` first
* `setuptools`_ is a (largely) drop-in replacement for ``distutils`` first
published in 2004. Its most notable addition over the unmodified
:mod:`distutils` tools was the ability to declare dependencies on other
``distutils`` tools was the ability to declare dependencies on other
packages. It is currently recommended as a more regularly updated
alternative to :mod:`distutils` that offers consistent support for more
alternative to ``distutils`` that offers consistent support for more
recent packaging standards across a wide range of Python versions.
* `wheel`_ (in this context) is a project that adds the ``bdist_wheel``
command to :mod:`distutils`/`setuptools`_. This produces a cross platform
command to ``distutils``/`setuptools`_. This produces a cross platform
binary packaging format (called "wheels" or "wheel files" and defined in
:pep:`427`) that allows Python libraries, even those including binary
extensions, to be installed on a system without needing to be built
Expand Down
5 changes: 0 additions & 5 deletions Doc/distutils/_setuptools_disclaimer.rst

This file was deleted.

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