Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/python/cpython into asyncio…
Browse files Browse the repository at this point in the history
…-zero-copy
  • Loading branch information
kumaraditya303 committed Oct 24, 2022
2 parents ee7e21e + 75a6fad commit 4b5c5fc
Show file tree
Hide file tree
Showing 209 changed files with 6,225 additions and 2,150 deletions.
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Python/traceback.c @iritkatriel
/Lib/html/ @ezio-melotti
/Lib/_markupbase.py @ezio-melotti
/Lib/test/test_html*.py @ezio-melotti
/Tools/scripts/*html5* @ezio-melotti
/Tools/build/parse_html5_entities.py @ezio-melotti

# Import (including importlib).
# Ignoring importlib.h so as to not get flagged on
Expand Down Expand Up @@ -135,7 +135,7 @@ Lib/ast.py @isidentical

**/*idlelib* @terryjreedy

**/*typing* @gvanrossum @Fidget-Spinner @JelleZijlstra
**/*typing* @gvanrossum @Fidget-Spinner @JelleZijlstra @AlexWaygood

**/*asyncore @giampaolo
**/*asynchat @giampaolo
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
id: check
run: |
if [ -z "$GITHUB_BASE_REF" ]; then
echo '::set-output name=run_tests::true'
echo "run_tests=true" >> $GITHUB_OUTPUT
else
git fetch origin $GITHUB_BASE_REF --depth=1
# git diff "origin/$GITHUB_BASE_REF..." (3 dots) may be more
Expand All @@ -57,7 +57,7 @@ jobs:
# into the PR branch anyway.
#
# https://github.com/python/core-workflow/issues/373
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc)' && echo '::set-output name=run_tests::true' || true
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc)' && echo "run_tests=true" >> $GITHUB_OUTPUT || true
fi
check_generated_files:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/verify-ensurepip-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ on:
paths:
- 'Lib/ensurepip/_bundled/**'
- '.github/workflows/verify-ensurepip-wheels.yml'
- 'Tools/scripts/verify_ensurepip_wheels.py'
- 'Tools/build/verify_ensurepip_wheels.py'
pull_request:
paths:
- 'Lib/ensurepip/_bundled/**'
- '.github/workflows/verify-ensurepip-wheels.yml'
- 'Tools/scripts/verify_ensurepip_wheels.py'
- 'Tools/build/verify_ensurepip_wheels.py'

permissions:
contents: read
Expand All @@ -29,4 +29,4 @@ jobs:
with:
python-version: '3'
- name: Compare checksums of bundled pip and setuptools to ones published on PyPI
run: ./Tools/scripts/verify_ensurepip_wheels.py
run: ./Tools/build/verify_ensurepip_wheels.py
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Tools/ssl/win32
Tools/freeze/test/outdir

# The frozen modules are always generated by the build so we don't
# keep them in the repo. Also see Tools/scripts/freeze_modules.py.
# keep them in the repo. Also see Tools/build/freeze_modules.py.
Python/frozen_modules/*.h
# The manifest can be generated at any time with "make regen-frozen".
Python/frozen_modules/MANIFEST
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/init.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1933,7 +1933,7 @@ is not possible due to its implementation being opaque at build time.
.. note::
A freed key becomes a dangling pointer. You should reset the key to
`NULL`.
``NULL``.
Methods
Expand Down
20 changes: 20 additions & 0 deletions Doc/c-api/refcounting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,26 @@ The macros in this section are used for managing reference counts of Python
objects.


.. c:function:: Py_ssize_t Py_REFCNT(PyObject *o)
Get the reference count of the Python object *o*.
Use the :c:func:`Py_SET_REFCNT()` function to set an object reference count.
.. versionchanged:: 3.11
The parameter type is no longer :c:expr:`const PyObject*`.
.. versionchanged:: 3.10
:c:func:`Py_REFCNT()` is changed to the inline static function.
.. c:function:: void Py_SET_REFCNT(PyObject *o, Py_ssize_t refcnt)
Set the object *o* reference counter to *refcnt*.
.. versionadded:: 3.9
.. c:function:: void Py_INCREF(PyObject *o)
Increment the reference count for object *o*.
Expand Down
23 changes: 2 additions & 21 deletions Doc/c-api/structures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ All Python objects ultimately share a small number of fields at the beginning
of the object's representation in memory. These are represented by the
:c:type:`PyObject` and :c:type:`PyVarObject` types, which are defined, in turn,
by the expansions of some macros also used, whether directly or indirectly, in
the definition of all other Python objects.
the definition of all other Python objects. Additional macros can be found
under :ref:`reference counting <countingrefs>`.


.. c:type:: PyObject
Expand Down Expand Up @@ -121,26 +122,6 @@ the definition of all other Python objects.
.. versionadded:: 3.9
.. c:function:: Py_ssize_t Py_REFCNT(PyObject *o)
Get the reference count of the Python object *o*.
Use the :c:func:`Py_SET_REFCNT()` function to set an object reference count.
.. versionchanged:: 3.11
The parameter type is no longer :c:expr:`const PyObject*`.
.. versionchanged:: 3.10
:c:func:`Py_REFCNT()` is changed to the inline static function.
.. c:function:: void Py_SET_REFCNT(PyObject *o, Py_ssize_t refcnt)
Set the object *o* reference counter to *refcnt*.
.. versionadded:: 3.9
.. c:function:: Py_ssize_t Py_SIZE(PyVarObject *o)
Get the size of the Python object *o*.
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/tuple.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Tuple Objects
Return the slice of the tuple pointed to by *p* between *low* and *high*,
or ``NULL`` on failure. This is the equivalent of the Python expression
``p[low:high]``. Indexing from the end of the list is not supported.
``p[low:high]``. Indexing from the end of the tuple is not supported.
.. c:function:: int PyTuple_SetItem(PyObject *p, Py_ssize_t pos, PyObject *o)
Expand Down
49 changes: 49 additions & 0 deletions Doc/c-api/type.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,55 @@ Type Objects
modification of the attributes or base classes of the type.
.. c:function:: int PyType_AddWatcher(PyType_WatchCallback callback)
Register *callback* as a type watcher. Return a non-negative integer ID
which must be passed to future calls to :c:func:`PyType_Watch`. In case of
error (e.g. no more watcher IDs available), return ``-1`` and set an
exception.
.. versionadded:: 3.12
.. c:function:: int PyType_ClearWatcher(int watcher_id)
Clear watcher identified by *watcher_id* (previously returned from
:c:func:`PyType_AddWatcher`). Return ``0`` on success, ``-1`` on error (e.g.
if *watcher_id* was never registered.)
An extension should never call ``PyType_ClearWatcher`` with a *watcher_id*
that was not returned to it by a previous call to
:c:func:`PyType_AddWatcher`.
.. versionadded:: 3.12
.. c:function:: int PyType_Watch(int watcher_id, PyObject *type)
Mark *type* as watched. The callback granted *watcher_id* by
:c:func:`PyType_AddWatcher` will be called whenever
:c:func:`PyType_Modified` reports a change to *type*. (The callback may be
called only once for a series of consecutive modifications to *type*, if
:c:func:`PyType_Lookup` is not called on *type* between the modifications;
this is an implementation detail and subject to change.)
An extension should never call ``PyType_Watch`` with a *watcher_id* that was
not returned to it by a previous call to :c:func:`PyType_AddWatcher`.
.. versionadded:: 3.12
.. c:type:: int (*PyType_WatchCallback)(PyObject *type)
Type of a type-watcher callback function.
The callback must not modify *type* or cause :c:func:`PyType_Modified` to be
called on *type* or any type in its MRO; violating this rule could cause
infinite recursion.
.. versionadded:: 3.12
.. c:function:: int PyType_HasFeature(PyTypeObject *o, int feature)
Return non-zero if the type object *o* sets the feature *feature*.
Expand Down
Loading

0 comments on commit 4b5c5fc

Please sign in to comment.