Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
68458bc
add patch from https://bugs.python.org/issue28607
eendebakpt Apr 16, 2022
f5ad0c3
add patch from https://bugs.python.org/issue28607
eendebakpt Apr 16, 2022
fefb5ac
fix clinic; add _copy to build
eendebakpt Apr 16, 2022
47824bd
refactor deepcopy c code
eendebakpt Jun 15, 2022
3d56fd3
validated tests
eendebakpt Jun 15, 2022
5507364
refactor code
eendebakpt Jun 15, 2022
a8f1792
Apply suggestions from code review
eendebakpt Jun 16, 2022
20e27ee
review comments
eendebakpt Jun 16, 2022
94b55cf
Merge branch 'deepcopy_c_implementation' of github.com:eendebakpt/cpy…
eendebakpt Jun 16, 2022
9a85e4a
address review comments
eendebakpt Jun 16, 2022
be33d78
Merge branch 'main' into deepcopy_c_implementation
eendebakpt Jul 4, 2022
28f2467
fix regen
eendebakpt Jul 4, 2022
b72365a
use vectorcall for python callback
eendebakpt Jul 4, 2022
2548d12
fix windows build
eendebakpt Jul 4, 2022
65f4ea4
address review comments
eendebakpt Jul 4, 2022
73b1300
Merge branch 'main' into deepcopy_c_implementation
eendebakpt Jul 16, 2022
5045ee2
Merge branch 'main' into deepcopy_c_implementation
eendebakpt Aug 11, 2022
c9a21f0
Merge branch 'main' into deepcopy_c_implementation
eendebakpt Aug 22, 2022
e21517c
fix AC
eendebakpt Aug 24, 2022
0e800fb
Merge branch 'main' into deepcopy_c_implementation
eendebakpt Aug 24, 2022
032c915
Merge branch 'main' into deepcopy_c_implementation
eendebakpt Sep 11, 2022
d9e94d9
Merge branch 'main' into deepcopy_c_implementation
eendebakpt Sep 26, 2022
1a9dd78
Merge branch 'main' into deepcopy_c_implementation
eendebakpt Oct 19, 2022
51a1aa8
remove setup.py
eendebakpt Oct 30, 2022
6b5216b
Merge branch 'main' into deepcopy_c_implementation
eendebakpt Oct 30, 2022
f6cf26d
regen
eendebakpt Oct 31, 2022
bc3efa0
Merge branch 'deepcopy_c_implementation' of githubeendebakpt:eendebak…
eendebakpt Oct 31, 2022
b7d2d45
use Py_newRef
eendebakpt Nov 10, 2022
7cf1ea0
Merge branch 'main' into deepcopy_c_implementation
eendebakpt Nov 10, 2022
9cf6181
Merge branch 'main' into deepcopy_c_implementation
eendebakpt Dec 20, 2022
08be03a
Merge branch 'main' into deepcopy_c_implementation
eendebakpt Jan 5, 2023
4e9a202
Merge branch 'main' into deepcopy_c_implementation
eendebakpt Jan 6, 2023
b50e6e5
Merge branch 'main' into deepcopy_c_implementation
eendebakpt Jan 18, 2023
132e2f3
wip
eendebakpt Feb 7, 2023
0e09898
Revert "wip"
eendebakpt Feb 7, 2023
8fa73a9
Merge branch 'main' into deepcopy_c_implementation
eendebakpt Feb 7, 2023
c7545d2
pep7 - part1
eendebakpt Feb 8, 2023
93480be
pep7 - part 2
eendebakpt Feb 8, 2023
0f945d1
ac
eendebakpt Feb 8, 2023
1fcb19d
pep7
eendebakpt Feb 8, 2023
424df01
pep7
eendebakpt Feb 8, 2023
c556530
ac
eendebakpt Feb 8, 2023
808bc5d
Merge branch 'main' into deepcopy_c_implementation
eendebakpt Feb 8, 2023
9275ea3
Merge branch 'main' into deepcopy_c_implementation
eendebakpt Feb 20, 2023
2c1ddb4
pep7
eendebakpt Feb 28, 2023
a736d2e
Merge branch 'main' into deepcopy_c_implementation
eendebakpt Feb 28, 2023
33eec1c
Merge branch 'main' into deepcopy_c_implementation
eendebakpt Mar 18, 2023
75375cd
make global C variables fully const
eendebakpt Mar 19, 2023
4071339
Merge branch 'main' into deepcopy_c_implementation
eendebakpt Jun 11, 2023
5915ead
fix merge issues
eendebakpt Jun 12, 2023
0228f64
Merge branch 'main' into deepcopy_c_implementation
eendebakpt Jun 12, 2023
066afe2
fix merge issues
eendebakpt Jun 12, 2023
d622575
Merge branch 'deepcopy_c_implementation' of githubeendebakpt:eendebak…
eendebakpt Jun 12, 2023
c38e150
Merge branch 'main' into deepcopy_c_implementation
eendebakpt Jun 28, 2023
1e43e5d
Merge branch 'main' into deepcopy_c_implementation
eendebakpt Aug 2, 2023
d074603
update for changed c api
eendebakpt Aug 2, 2023
22e7610
Merge branch 'main' into deepcopy_c_implementation
eendebakpt Sep 10, 2023
0e8f043
include pycore_dict.h header
eendebakpt Sep 12, 2023
83c2fdb
Merge branch 'main' into deepcopy_c_implementation
eendebakpt Sep 12, 2023
b76a43c
fix _PyDict_NewPresized
eendebakpt Sep 12, 2023
ce5f28a
fix _PyDict_NewPresized
eendebakpt Sep 12, 2023
f155330
fix _PyDict_NewPresized
eendebakpt Sep 12, 2023
2be1c3b
align PR with addition of copy.replace
eendebakpt Sep 12, 2023
61ad279
pylint
eendebakpt Sep 12, 2023
74098d7
make _PyDict_NewPresized available in shared extensions
eendebakpt Sep 13, 2023
62b7c76
make regen-all
eendebakpt Sep 13, 2023
fb5e27a
Merge branch 'main' into deepcopy_c_implementation
eendebakpt Oct 4, 2023
8f6aad7
resolve merge changes
eendebakpt Oct 4, 2023
ce8bed7
Merge branch 'main' into deepcopy_c_implementation
eendebakpt Oct 16, 2023
93c2d57
Merge branch 'main' into deepcopy_c_implementation
eendebakpt Nov 16, 2023
e6379d0
Merge branch 'main' into deepcopy_c_implementation
eendebakpt Dec 14, 2023
0971be5
update argument clinic
eendebakpt Dec 14, 2023
6d13239
resolve merge conflicts
eendebakpt Dec 14, 2023
35cdca5
Merge branch 'main' into deepcopy_c_implementation
erlend-aasland Apr 4, 2024
6097604
Merge branch 'main' into deepcopy_c_implementation
Jun 9, 2024
fde2b83
Merge branch 'main' into deepcopy_c_implementation
eendebakpt Jun 9, 2024
9bef684
Merge branch 'main' into deepcopy_c_implementation
eendebakpt Aug 29, 2024
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
Prev Previous commit
Next Next commit
Merge branch 'main' into deepcopy_c_implementation
  • Loading branch information
eendebakpt committed Jul 16, 2022
commit 73b1300c3747a45bc10b679cbbf04bb22d884b95
47 changes: 24 additions & 23 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -62,26 +62,27 @@ PCbuild/readme.txt dos
#
[attr]generated linguist-generated=true diff=generated

**/clinic/*.c.h generated
*_db.h generated
Doc/data/stable_abi.dat generated
Doc/library/token-list.inc generated
Include/internal/pycore_ast.h generated
Include/internal/pycore_ast_state.h generated
Include/internal/pycore_opcode.h generated
Include/opcode.h generated
Include/token.h generated
Lib/keyword.py generated
Lib/test/test_stable_abi_ctypes.py generated
Lib/token.py generated
Objects/typeslots.inc generated
PC/python3dll.c generated
Parser/parser.c generated
Parser/token.c generated
Programs/test_frozenmain.h generated
Python/Python-ast.c generated
Python/opcode_targets.h generated
Python/stdlib_module_names.h generated
Tools/peg_generator/pegen/grammar_parser.py generated
aclocal.m4 generated
configure generated
**/clinic/*.c.h generated
*_db.h generated
Doc/data/stable_abi.dat generated
Doc/library/token-list.inc generated
Include/internal/pycore_ast.h generated
Include/internal/pycore_ast_state.h generated
Include/internal/pycore_opcode.h generated
Include/internal/pycore_runtime_init_generated.h generated
Include/opcode.h generated
Include/token.h generated
Lib/keyword.py generated
Lib/test/test_stable_abi_ctypes.py generated
Lib/token.py generated
Objects/typeslots.inc generated
PC/python3dll.c generated
Parser/parser.c generated
Parser/token.c generated
Programs/test_frozenmain.h generated
Python/Python-ast.c generated
Python/opcode_targets.h generated
Python/stdlib_module_names.h generated
Tools/peg_generator/pegen/grammar_parser.py generated
aclocal.m4 generated
configure generated
2 changes: 1 addition & 1 deletion Doc/c-api/allocation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Allocating Objects on the Heap

.. c:function:: PyObject* PyObject_Init(PyObject *op, PyTypeObject *type)

Initialize a newly-allocated object *op* with its type and initial
Initialize a newly allocated object *op* with its type and initial
reference. Returns the initialized object. If *type* indicates that the
object participates in the cyclic garbage detector, it is added to the
detector's set of observed objects. Other fields of the object are not
Expand Down
19 changes: 19 additions & 0 deletions Doc/c-api/datetime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,15 @@ Macros to create objects:
resulting number of microseconds and seconds lie in the ranges documented for
:class:`datetime.timedelta` objects.


.. c:function:: PyObject* PyTimeZone_FromOffset(PyDateTime_DeltaType* offset)

Return a :class:`datetime.timezone` object with an unnamed fixed offset
represented by the *offset* argument.

.. versionadded:: 3.7


.. c:function:: PyObject* PyTimeZone_FromOffsetAndName(PyDateTime_DeltaType* offset, PyUnicode* name)

Return a :class:`datetime.timezone` object with a fixed offset represented
Expand Down Expand Up @@ -190,12 +192,21 @@ must not be ``NULL``, and the type is not checked:

Return the microsecond, as an int from 0 through 999999.


.. c:function:: int PyDateTime_DATE_GET_FOLD(PyDateTime_DateTime *o)

Return the fold, as an int from 0 through 1.

.. versionadded:: 3.6


.. c:function:: PyObject* PyDateTime_DATE_GET_TZINFO(PyDateTime_DateTime *o)

Return the tzinfo (which may be ``None``).

.. versionadded:: 3.10


Macros to extract fields from time objects. The argument must be an instance of
:c:data:`PyDateTime_Time`, including subclasses. The argument must not be ``NULL``,
and the type is not checked:
Expand All @@ -219,6 +230,14 @@ and the type is not checked:

Return the microsecond, as an int from 0 through 999999.


.. c:function:: int PyDateTime_TIME_GET_FOLD(PyDateTime_Time *o)

Return the fold, as an int from 0 through 1.

.. versionadded:: 3.6


.. c:function:: PyObject* PyDateTime_TIME_GET_TZINFO(PyDateTime_Time *o)

Return the tzinfo (which may be ``None``).
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ A full list of the various types of debugging builds is in the file
:file:`Misc/SpecialBuilds.txt` in the Python source distribution. Builds are
available that support tracing of reference counts, debugging the memory
allocator, or low-level profiling of the main interpreter loop. Only the most
frequently-used builds will be described in the remainder of this section.
frequently used builds will be described in the remainder of this section.

Compiling the interpreter with the :c:macro:`Py_DEBUG` macro defined produces
what is generally meant by :ref:`a debug build of Python <debug-build>`.
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/memory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ memory manager. For example, this is required when the interpreter is extended
with new object types written in C. Another reason for using the Python heap is
the desire to *inform* the Python memory manager about the memory needs of the
extension module. Even when the requested memory is used exclusively for
internal, highly-specific purposes, delegating all memory requests to the Python
internal, highly specific purposes, delegating all memory requests to the Python
memory manager causes the interpreter to have a more accurate image of its
memory footprint as a whole. Consequently, under certain circumstances, the
Python memory manager may or may not trigger appropriate actions, like garbage
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/typeobj.rst
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ type objects) *must* have the :attr:`ob_size` field.
``PyObject_HEAD_INIT`` macro. For :ref:`statically allocated objects
<static-types>`, these fields always remain ``NULL``. For :ref:`dynamically
allocated objects <heap-types>`, these two fields are used to link the
object into a doubly-linked list of *all* live objects on the heap.
object into a doubly linked list of *all* live objects on the heap.

This could be used for various debugging purposes; currently the only uses
are the :func:`sys.getobjects` function and to print the objects that are
Expand Down
4 changes: 2 additions & 2 deletions Doc/c-api/weakref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ as much as it can.
callable object that receives notification when *ob* is garbage collected; it
should accept a single parameter, which will be the weak reference object
itself. *callback* may also be ``None`` or ``NULL``. If *ob* is not a
weakly-referencable object, or if *callback* is not callable, ``None``, or
weakly referencable object, or if *callback* is not callable, ``None``, or
``NULL``, this will return ``NULL`` and raise :exc:`TypeError`.


Expand All @@ -47,7 +47,7 @@ as much as it can.
be a callable object that receives notification when *ob* is garbage
collected; it should accept a single parameter, which will be the weak
reference object itself. *callback* may also be ``None`` or ``NULL``. If *ob*
is not a weakly-referencable object, or if *callback* is not callable,
is not a weakly referencable object, or if *callback* is not callable,
``None``, or ``NULL``, this will return ``NULL`` and raise :exc:`TypeError`.


Expand Down
2 changes: 1 addition & 1 deletion Doc/distutils/apiref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@ other utility module.
it contains certain values: see :func:`check_environ`. Raise :exc:`ValueError`
for any variables not found in either *local_vars* or ``os.environ``.

Note that this is not a fully-fledged string interpolation function. A valid
Note that this is not a full-fledged string interpolation function. A valid
``$variable`` can consist only of upper and lower case letters, numbers and an
underscore. No { } or ( ) style quoting is available.

Expand Down
2 changes: 1 addition & 1 deletion Doc/extending/building.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The initialization function has the signature:

.. c:function:: PyObject* PyInit_modulename(void)
It returns either a fully-initialized module, or a :c:type:`PyModuleDef`
It returns either a fully initialized module, or a :c:type:`PyModuleDef`
instance. See :ref:`initializing-modules` for details.
.. highlight:: python
Expand Down
4 changes: 2 additions & 2 deletions Doc/extending/newtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ example::
}

If no :c:member:`~PyTypeObject.tp_repr` handler is specified, the interpreter will supply a
representation that uses the type's :c:member:`~PyTypeObject.tp_name` and a uniquely-identifying
representation that uses the type's :c:member:`~PyTypeObject.tp_name` and a uniquely identifying
value for the object.

The :c:member:`~PyTypeObject.tp_str` handler is to :func:`str` what the :c:member:`~PyTypeObject.tp_repr` handler
Expand Down Expand Up @@ -589,7 +589,7 @@ with the required field::
PyObject *weakreflist; /* List of weak references */
} TrivialObject;

And the corresponding member in the statically-declared type object::
And the corresponding member in the statically declared type object::

static PyTypeObject TrivialType = {
PyVarObject_HEAD_INIT(NULL, 0)
Expand Down
2 changes: 1 addition & 1 deletion Doc/faq/design.rst
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ you're too lazy to define a function.

Functions are already first class objects in Python, and can be declared in a
local scope. Therefore the only advantage of using a lambda instead of a
locally-defined function is that you don't need to invent a name for the
locally defined function is that you don't need to invent a name for the
function -- but that's just a local variable to which the function object (which
is exactly the same type of object that a lambda expression yields) is assigned!

Expand Down
4 changes: 2 additions & 2 deletions Doc/faq/programming.rst
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ It's good practice if you import modules in the following order:
1. standard library modules -- e.g. ``sys``, ``os``, ``getopt``, ``re``
2. third-party library modules (anything installed in Python's site-packages
directory) -- e.g. mx.DateTime, ZODB, PIL.Image, etc.
3. locally-developed modules
3. locally developed modules

It is sometimes necessary to move imports to a function or class to avoid
problems with circular imports. Gordon McMillan says:
Expand Down Expand Up @@ -771,7 +771,7 @@ What does the slash(/) in the parameter list of a function mean?

A slash in the argument list of a function denotes that the parameters prior to
it are positional-only. Positional-only parameters are the ones without an
externally-usable name. Upon calling a function that accepts positional-only
externally usable name. Upon calling a function that accepts positional-only
parameters, arguments are mapped to parameters based solely on their position.
For example, :func:`divmod` is a function that accepts positional-only
parameters. Its documentation looks like this::
Expand Down
2 changes: 1 addition & 1 deletion Doc/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ Glossary
machines.

However, some extension modules, either standard or third-party,
are designed so as to release the GIL when doing computationally-intensive
are designed so as to release the GIL when doing computationally intensive
tasks such as compression or hashing. Also, the GIL is always released
when doing I/O.

Expand Down
6 changes: 3 additions & 3 deletions Doc/howto/clinic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ Let's dive in!

16. Compile, then run the relevant portions of the regression-test suite.
This change should not introduce any new compile-time warnings or errors,
and there should be no externally-visible change to Python's behavior.
and there should be no externally visible change to Python's behavior.

Well, except for one difference: ``inspect.signature()`` run on your function
should now provide a valid signature!
Expand Down Expand Up @@ -1117,7 +1117,7 @@ Here's the syntax for cloning a function::
``module.class`` in the sample just to illustrate that you must
use the full path to *both* functions.)

Sorry, there's no syntax for partially-cloning a function, or cloning a function
Sorry, there's no syntax for partially cloning a function, or cloning a function
then modifying it. Cloning is an all-or nothing proposition.

Also, the function you are cloning from must have been previously defined
Expand Down Expand Up @@ -1315,7 +1315,7 @@ to specify in your subclass. Here's the current list:
there is no default, but not specifying a default may
result in an "uninitialized variable" warning. This can
easily happen when using option groups—although
properly-written code will never actually use this value,
properly written code will never actually use this value,
the variable does get passed in to the impl, and the
C compiler will complain about the "use" of the
uninitialized value. This value should always be a
Expand Down
2 changes: 1 addition & 1 deletion Doc/howto/functional.rst
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ further because you risk skipping a discarded element.
The itertools module
====================

The :mod:`itertools` module contains a number of commonly-used iterators as well
The :mod:`itertools` module contains a number of commonly used iterators as well
as functions for combining several iterators. This section will introduce the
module's contents by showing small examples.

Expand Down
1 change: 1 addition & 0 deletions Doc/howto/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ Currently, the HOWTOs are:
clinic.rst
instrumentation.rst
annotations.rst
isolating-extensions.rst

4 changes: 2 additions & 2 deletions Doc/howto/instrumentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Sufficiently modern readelf can print the metadata::
Arguments: 8@%rbp 8@%r12 -4@%eax

The above metadata contains information for SystemTap describing how it
can patch strategically-placed machine code instructions to enable the
can patch strategically placed machine code instructions to enable the
tracing hooks used by a SystemTap script.


Expand Down Expand Up @@ -410,7 +410,7 @@ needing to directly name the static markers:


The following script uses the tapset above to provide a top-like view of all
running CPython code, showing the top 20 most frequently-entered bytecode
running CPython code, showing the top 20 most frequently entered bytecode
frames, each second, across the whole system:

.. code-block:: none
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.