8000 Pull in main · python/cpython@00a7562 · GitHub
[go: up one dir, main page]

Skip to content

Commit 00a7562

Browse files
Pull in main
2 parents daea15e + 65ce365 commit 00a7562

27 files changed

+341
-181
lines changed

Doc/howto/clinic.rst

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,11 @@ The CLI supports the following options:
188188

189189
The directory tree to walk in :option:`--make` mode.
190190

191+
.. option:: --exclude EXCLUDE
192+
193+
A file to exclude in :option:`--make` mode.
194+
This option can be given multiple times.
195+
191196
.. option:: FILE ...
192197

193198
The list of files to process.
@@ -1925,13 +1930,14 @@ Example from :source:`Objects/codeobject.c`::
19251930
Return a copy of the code object with new values for the specified fields.
19261931
[clinic start generated output]*/
19271932

1928-
The generated docstring ends up looking like this::
1933+
The generated docstring ends up looking like this:
19291934

1930-
Doc_STRVAR(code_replace__doc__,
1931-
"replace($self, /, **changes)\n"
1932-
"--\n"
1933-
"\n"
1934-
"Return a copy of the code object with new values for the specified fields.");
1935+
.. code-block:: none
1936+
1937+
replace($self, /, **changes)
1938+
--
1939+
1940+
Return a copy of the code object with new values for the specified fields.
19351941
19361942
19371943
.. _clinic-howto-deprecate-positional:
@@ -1963,7 +1969,7 @@ whenever the *b* parameter is passed positionally,
19631969
and we'll be allowed to make it keyword-only in Python 3.14 at the earliest.
19641970

19651971
We can use Argument Clinic to emit the desired deprecation warnings
1966-
using the ``* [from ...]``` syntax,
1972+
using the ``* [from ...]`` syntax,
19671973
by adding the line ``* [from 3.14]`` right above the *b* parameter::
19681974

19691975
/*[clinic input]
@@ -1995,12 +2001,12 @@ Luckily for us, compiler warnings are now generated:
19952001
.. code-block:: none
19962002
19972003
In file included from Modules/foomodule.c:139:
1998-
Modules/clinic/foomodule.c.h:83:8: warning: Update 'b' in 'myfunc' in 'foomodule.c' to be keyword-only. [-W#warnings]
1999-
# warning "Update 'b' in 'myfunc' in 'foomodule.c' to be keyword-only."
2004+
Modules/clinic/foomodule.c.h:139:8: warning: In 'foomodule.c', update parameter(s) 'a' and 'b' in the clinic input of 'mymod.myfunc' to be keyword-only. [-W#warnings]
2005+
# warning "In 'foomodule.c', update parameter(s) 'a' and 'b' in the clinic input of 'mymod.myfunc' to be keyword-only. [-W#warnings]"
20002006
^
20012007
20022008
We now close the deprecation phase by making *b* keyword-only;
2003-
replace the ``* [from ...]``` line above *b*
2009+
replace the ``* [from ...]`` line above *b*
20042010
with the ``*`` from the line above *c*::
20052011

20062012
/*[clinic input]

Include/internal/pycore_instruments.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,6 @@ extern int
9090
_Py_call_instrumentation_2args(PyThreadState *tstate, int event,
9191
_PyInterpreterFrame *frame, _Py_CODEUNIT *instr, PyObject *arg0, PyObject *arg1);
9292

93-
extern void
94-
_Py_call_instrumentation_exc0(PyThreadState *tstate, int event,
95-
_PyInterpreterFrame *frame, _Py_CODEUNIT *instr);
96-
9793
extern void
9894
_Py_call_instrumentation_exc2(PyThreadState *tstate, int event,
9995
_PyInterpreterFrame *frame, _Py_CODEUNIT *instr, PyObject *arg0, PyObject *arg1);

Include/internal/pycore_opcode.h

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_opcode_metadata.h

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/opcode.h

Lines changed: 52 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Lib/_opcode_metadata.py

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Lib/re/_compiler.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@ def _compile(code, pattern, flags):
100100
emit(ANY_ALL)
101101
else:
102102
emit(ANY)
103+
elif op is POSSESSIVE_REPEAT:
104+
# gh-106052: Possessive quantifiers do not work when the
105+
# subpattern contains backtracking, i.e. "(?:ab?c)*+".
106+
# Implement it as equivalent greedy qualifier in atomic group.
107+
p = [(MAX_REPEAT, av)]
108+
p = [(ATOMIC_GROUP, p)]
109+
_compile(code, p, flags)
103110
elif op in REPEATING_CODES:
104111
if _simple(av[2]):
105112
emit(REPEATING_CODES[op][2])

Lib/statistics.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,6 +1009,8 @@ def _sqrtprod(x: float, y: float) -> float:
10091009
# Square root differential correction:
10101010
# https://www.wolframalpha.com/input/?i=Maclaurin+series+sqrt%28h**2+%2B+x%29+at+x%3D0
10111011
h = sqrt(x * y)
1012+
if not h:
1013+
return 0.0
10121014
x = sumprod((x, h), (y, -h))
10131015
return h + x / (2.0 * h)
10141016

0 commit comments

Comments
 (0)
0