Skip to content

Commit

Permalink
Merge branch 'main' into supermon
Browse files Browse the repository at this point in the history
* main: (156 commits)
  pythongh-97696 Add documentation for get_coro() behavior with eager tasks (python#104304)
  pythongh-97933: (PEP 709) inline list/dict/set comprehensions (python#101441)
  pythongh-99889: Fix directory traversal security flaw in uu.decode() (python#104096)
  pythongh-104184: fix building --with-pydebug --enable-pystats (python#104217)
  pythongh-104139: Add itms-services to uses_netloc urllib.parse. (python#104312)
  pythongh-104240: return code unit metadata from codegen (python#104300)
  pythongh-104276: Make `_struct.unpack_iterator` type use type flag instead of custom constructor (python#104277)
  pythongh-97696: Move around and update the whatsnew entry for asyncio eager task factory (python#104298)
  pythongh-103193: Fix refleaks in `test_inspect` and `test_typing` (python#104320)
  require-pr-label.yml: Add missing "permissions:" (python#104309)
  pythongh-90656: Add platform triplets for 64-bit LoongArch (LA64) (python#30939)
  pythongh-104180: Read SOCKS proxies from macOS System Configuration (python#104181)
  pythongh-97696 Remove unnecessary check for eager_start kwarg (python#104188)
  pythonGH-104308: socket.getnameinfo should release the GIL (python#104307)
  pythongh-104310: Add importlib.util.allowing_all_extensions() (pythongh-104311)
  pythongh-99113: A Per-Interpreter GIL! (pythongh-104210)
  pythonGH-104284: Fix documentation gettext build (python#104296)
  pythongh-89550: Buffer GzipFile.write to reduce execution time by ~15% (python#101251)
  pythongh-104223: Fix issues with inheriting from buffer classes (python#104227)
  pythongh-99108: fix typo in Modules/Setup (python#104293)
  ...
  • Loading branch information
carljm committed May 9, 2023
2 parents e32166d + 2866e03 commit c48eee3
Show file tree
Hide file tree
Showing 555 changed files with 16,437 additions and 8,226 deletions.
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
# GitHub
.github/** @ezio-melotti @hugovk

# pre-commit
.pre-commit-config.yaml @hugovk @AlexWaygood

# Build system
configure* @erlend-aasland @corona10

Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Lint

on: [push, pull_request, workflow_dispatch]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- uses: pre-commit/[email protected]
4 changes: 4 additions & 0 deletions .github/workflows/require-pr-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
pull_request:
types: [opened, reopened, labeled, unlabeled, synchronize]

permissions:
issues: read
pull-requests: read

jobs:
label:
name: DO-NOT-MERGE / unresolved review
Expand Down
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- id: trailing-whitespace
types_or: [c, python, rst]
2 changes: 1 addition & 1 deletion Doc/c-api/bytearray.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Byte Array Objects
------------------

.. index:: object: bytearray
.. index:: pair: object; bytearray


.. c:type:: PyByteArrayObject
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/bytes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Bytes Objects
These functions raise :exc:`TypeError` when expecting a bytes parameter and
called with a non-bytes parameter.

.. index:: object: bytes
.. index:: pair: object; bytes


.. c:type:: PyBytesObject
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/capsule.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Capsules
--------

.. index:: object: Capsule
.. index:: pair: object; Capsule

Refer to :ref:`using-capsules` for more information on using these objects.

Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/complex.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Complex Number Objects
----------------------

.. index:: object: complex number
.. index:: pair: object; complex number

Python's complex number objects are implemented as two distinct types when
viewed from the C API: one is the Python object exposed to Python programs, and
Expand Down
6 changes: 3 additions & 3 deletions Doc/c-api/concrete.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ This section describes Python type objects and the singleton object ``None``.
Numeric Objects
===============

.. index:: object: numeric
.. index:: pair: object; numeric

.. toctree::

Expand All @@ -55,7 +55,7 @@ Numeric Objects
Sequence Objects
================

.. index:: object: sequence
.. index:: pair: object; sequence

Generic operations on sequence objects were discussed in the previous chapter;
this section deals with the specific kinds of sequence objects that are
Expand All @@ -77,7 +77,7 @@ intrinsic to the Python language.
Container Objects
=================

.. index:: object: mapping
.. index:: pair: object; mapping

.. toctree::

Expand Down
4 changes: 2 additions & 2 deletions Doc/c-api/dict.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Dictionary Objects
------------------

.. index:: object: dictionary
.. index:: pair: object; dictionary


.. c:type:: PyDictObject
Expand Down Expand Up @@ -154,7 +154,7 @@ Dictionary Objects
.. c:function:: Py_ssize_t PyDict_Size(PyObject *p)
.. index:: builtin: len
.. index:: pair: built-in function; len
Return the number of items in the dictionary. This is equivalent to
``len(p)`` on a dictionary.
Expand Down
6 changes: 3 additions & 3 deletions Doc/c-api/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ Signal Handling
.. c:function:: int PyErr_CheckSignals()
.. index::
module: signal
pair: module; signal
single: SIGINT
single: KeyboardInterrupt (built-in exception)
Expand Down Expand Up @@ -633,7 +633,7 @@ Signal Handling
.. c:function:: void PyErr_SetInterrupt()
.. index::
module: signal
pair: module; signal
single: SIGINT
single: KeyboardInterrupt (built-in exception)
Expand All @@ -648,7 +648,7 @@ Signal Handling
.. c:function:: int PyErr_SetInterruptEx(int signum)
.. index::
module: signal
pair: module; signal
single: KeyboardInterrupt (built-in exception)
Simulate the effect of a signal arriving. The next time
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
File Objects
------------

.. index:: object: file
.. index:: pair: object; file

These APIs are a minimal emulation of the Python 2 C API for built-in file
objects, which used to rely on the buffered I/O (:c:expr:`FILE*`) support
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/float.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Floating Point Objects
----------------------

.. index:: object: floating point
.. index:: pair: object; floating point


.. c:type:: PyFloatObject
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/function.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Function Objects
----------------

.. index:: object: function
.. index:: pair: object; function

There are a few functions specific to Python functions.

Expand Down
21 changes: 20 additions & 1 deletion Doc/c-api/gcsupport.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,31 @@ rules:
Analogous to :c:func:`PyObject_New` but for container objects with the
:const:`Py_TPFLAGS_HAVE_GC` flag set.
.. c:function:: TYPE* PyObject_GC_NewVar(TYPE, PyTypeObject *type, Py_ssize_t size)
Analogous to :c:func:`PyObject_NewVar` but for container objects with the
:const:`Py_TPFLAGS_HAVE_GC` flag set.
.. c:function:: PyObject* PyUnstable_Object_GC_NewWithExtraData(PyTypeObject *type, size_t extra_size)
Analogous to :c:func:`PyObject_GC_New` but allocates *extra_size*
bytes at the end of the object (at offset
:c:member:`~PyTypeObject.tp_basicsize`).
The allocated memory is initialized to zeros,
except for the :c:type:`Python object header <PyObject>`.
The extra data will be deallocated with the object, but otherwise it is
not managed by Python.
.. warning::
The function is marked as unstable because the final mechanism
for reserving extra data after an instance is not yet decided.
For allocating a variable number of fields, prefer using
:c:type:`PyVarObject` and :c:member:`~PyTypeObject.tp_itemsize`
instead.
.. versionadded:: 3.12
.. c:function:: TYPE* PyObject_GC_Resize(TYPE, PyVarObject *op, Py_ssize_t newsize)
Expand Down
8 changes: 4 additions & 4 deletions Doc/c-api/import.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Importing Modules
.. c:function:: PyObject* PyImport_ImportModuleEx(const char *name, PyObject *globals, PyObject *locals, PyObject *fromlist)
.. index:: builtin: __import__
.. index:: pair: built-in function; __import__
Import a module. This is best described by referring to the built-in Python
function :func:`__import__`.
Expand Down Expand Up @@ -120,7 +120,7 @@ Importing Modules
.. c:function:: PyObject* PyImport_ExecCodeModule(const char *name, PyObject *co)
.. index:: builtin: compile
.. index:: pair: built-in function; compile
Given a module name (possibly of the form ``package.module``) and a code object
read from a Python bytecode file or obtained from the built-in function
Expand Down Expand Up @@ -186,10 +186,10 @@ Importing Modules
.. versionadded:: 3.2
.. versionchanged:: 3.3
Uses :func:`imp.source_from_cache()` in calculating the source path if
Uses :func:`!imp.source_from_cache()` in calculating the source path if
only the bytecode path is provided.
.. versionchanged:: 3.12
No longer uses the removed ``imp`` module.
No longer uses the removed :mod:`!imp` module.
.. c:function:: long PyImport_GetMagicNumber()
Expand Down
14 changes: 7 additions & 7 deletions Doc/c-api/init.rst
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,9 @@ Initializing and finalizing the interpreter
single: PyEval_InitThreads()
single: modules (in module sys)
single: path (in module sys)
module: builtins
module: __main__
module: sys
pair: module; builtins
pair: module; __main__
pair: module; sys
triple: module; search; path
single: PySys_SetArgv()
single: PySys_SetArgvEx()
Expand Down Expand Up @@ -1051,7 +1051,7 @@ code, or when embedding the Python interpreter:
.. deprecated:: 3.9
.. index:: module: _thread
.. index:: pair: module; _thread
.. c:function:: int PyEval_ThreadsInitialized()
Expand Down Expand Up @@ -1494,9 +1494,9 @@ function. You can create and destroy them using the following functions:
.. c:function:: PyThreadState* Py_NewInterpreter()
.. index::
module: builtins
module: __main__
module: sys
pair: module; builtins
pair: module; __main__
pair: module; sys
single: stdout (in module sys)
single: stderr (in module sys)
single: stdin (in module sys)
Expand Down
8 changes: 4 additions & 4 deletions Doc/c-api/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ complete listing.
Objects, Types and Reference Counts
===================================

.. index:: object: type
.. index:: pair: object; type

Most Python/C API functions have one or more arguments as well as a return value
of type :c:expr:`PyObject*`. This type is a pointer to an opaque data type
Expand Down Expand Up @@ -705,9 +705,9 @@ interpreter can only be used after the interpreter has been initialized.

.. index::
single: Py_Initialize()
module: builtins
module: __main__
module: sys
pair: module; builtins
pair: module; __main__
pair: module; sys
triple: module; search; path
single: path (in module sys)

Expand Down
6 changes: 3 additions & 3 deletions Doc/c-api/list.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
List Objects
------------

.. index:: object: list
.. index:: pair: object; list


.. c:type:: PyListObject
Expand Down Expand Up @@ -45,7 +45,7 @@ List Objects
.. c:function:: Py_ssize_t PyList_Size(PyObject *list)
.. index:: builtin: len
.. index:: pair: built-in function; len
Return the length of the list object in *list*; this is equivalent to
``len(list)`` on a list object.
Expand Down Expand Up @@ -138,7 +138,7 @@ List Objects
.. c:function:: PyObject* PyList_AsTuple(PyObject *list)
.. index:: builtin: tuple
.. index:: pair: built-in function; tuple
Return a new tuple object containing the contents of *list*; equivalent to
``tuple(list)``.
4 changes: 2 additions & 2 deletions Doc/c-api/long.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
Integer Objects
---------------

.. index:: object: long integer
object: integer
.. index:: pair: object; long integer
pair: object; integer

All integers are implemented as "long" integer objects of arbitrary size.

Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/mapping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ See also :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` and
.. c:function:: Py_ssize_t PyMapping_Size(PyObject *o)
Py_ssize_t PyMapping_Length(PyObject *o)
.. index:: builtin: len
.. index:: pair: built-in function; len
Returns the number of keys in object *o* on success, and ``-1`` on failure.
This is equivalent to the Python expression ``len(o)``.
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/memoryview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.. _memoryview-objects:

.. index::
object: memoryview
pair: object; memoryview

MemoryView objects
------------------
Expand Down
4 changes: 2 additions & 2 deletions Doc/c-api/method.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Instance Method Objects
-----------------------

.. index:: object: instancemethod
.. index:: pair: object; instancemethod

An instance method is a wrapper for a :c:data:`PyCFunction` and the new way
to bind a :c:data:`PyCFunction` to a class object. It replaces the former call
Expand Down Expand Up @@ -47,7 +47,7 @@ to bind a :c:data:`PyCFunction` to a class object. It replaces the former call
Method Objects
--------------
.. index:: object: method
.. index:: pair: object; method
Methods are bound function objects. Methods are always bound to an instance of
a user-defined class. Unbound methods (methods bound to a class object) are
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Module Objects
--------------

.. index:: object: module
.. index:: pair: object; module


.. c:var:: PyTypeObject PyModule_Type
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/none.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
The ``None`` Object
-------------------

.. index:: object: None
.. index:: pair: object; None

Note that the :c:type:`PyTypeObject` for ``None`` is not directly exposed in the
Python/C API. Since ``None`` is a singleton, testing for object identity (using
Expand Down
Loading

0 comments on commit c48eee3

Please sign in to comment.