Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3b68cda

Browse filesBrowse files
authored
Merge branch 'python:main' into fix-typevar-test
2 parents a3c54d5 + 1578de2 commit 3b68cda
Copy full SHA for 3b68cda
Expand file treeCollapse file tree

40 files changed

+298
-93
lines changed
Open diff view settings
Collapse file

‎Doc/Makefile‎

Copy file name to clipboardExpand all lines: Doc/Makefile
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ PAPER =
1212
SOURCES =
1313
DISTVERSION = $(shell $(PYTHON) tools/extensions/patchlevel.py)
1414
SPHINXERRORHANDLING = -W
15+
SERVE_PORT =
1516

1617
# Internal variables.
1718
PAPEROPT_a4 = -D latex_elements.papersize=a4paper
@@ -217,7 +218,7 @@ check:
217218
$(PYTHON) tools/rstlint.py ../Misc/NEWS.d/next/
218219

219220
serve:
220-
$(PYTHON) ../Tools/scripts/serve.py build/html
221+
$(PYTHON) ../Tools/scripts/serve.py build/html $(SERVE_PORT)
221222

222223
# Targets for daily automated doc build
223224
# By default, Sphinx only rebuilds pages where the page content has changed.
Collapse file

‎Doc/library/cgi.rst‎

Copy file name to clipboardExpand all lines: Doc/library/cgi.rst
+5Lines changed: 5 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ Support module for Common Gateway Interface (CGI) scripts.
2121
This module defines a number of utilities for use by CGI scripts written in
2222
Python.
2323

24+
The global variable ``maxlen`` can be set to an integer indicating the maximum
25+
size of a POST request. POST requests larger than this size will result in a
26+
:exc:`ValueError` being raised during parsing. The default value of this
27+
variable is ``0``, meaning the request size is unlimited.
28+
2429

2530
Introduction
2631
------------
Collapse file

‎Doc/library/re.rst‎

Copy file name to clipboardExpand all lines: Doc/library/re.rst
+16Lines changed: 16 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,11 @@ form.
637637
programs that use only a few regular expressions at a time needn't worry
638638
about compiling regular expressions.
639639

640+
.. class:: RegexFlag
641+
642+
An :class:`enum.IntFlag` class containing the regex options listed below.
643+
644+
.. versionadded:: 3.11 - added to ``__all__``
640645

641646
.. data:: A
642647
ASCII
@@ -710,6 +715,17 @@ form.
710715
string and immediately before the newline (if any) at the end of the string.
711716
Corresponds to the inline flag ``(?m)``.
712717

718+
.. data:: NOFLAG
719+
720+
Indicates no flag being applied, the value is ``0``. This flag may be used
721+
as a default value for a function keyword argument or as a base value that
722+
will be conditionally ORed with other flags. Example of use as a default
723+
value::
724+
725+
def myfunc(text, flag=re.NOFLAG):
726+
return re.match(text, flag)
727+
728+
.. versionadded:: 3.11
713729

714730
.. data:: S
715731
DOTALL
Collapse file

‎Doc/tutorial/floatingpoint.rst‎

Copy file name to clipboardExpand all lines: Doc/tutorial/floatingpoint.rst
+3-9Lines changed: 3 additions & 9 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,9 @@ Floating Point Arithmetic: Issues and Limitations
1212

1313

1414
Floating-point numbers are represented in computer hardware as base 2 (binary)
15-
fractions. For example, the decimal fraction ::
16-
17-
0.125
18-
19-
has value 1/10 + 2/100 + 5/1000, and in the same way the binary fraction ::
20-
21-
0.001
22-
23-
has value 0/2 + 0/4 + 1/8. These two fractions have identical values, the only
15+
fractions. For example, the **decimal** fraction ``0.125``
16+
has value 1/10 + 2/100 + 5/1000, and in the same way the **binary** fraction ``0.001``
17+
has value 0/2 + 0/4 + 1/8. These two fractions have identical values, the only
2418
real difference being that the first is written in base 10 fractional notation,
2519
and the second in base 2.
2620

Collapse file

‎Doc/whatsnew/3.11.rst‎

Copy file name to clipboardExpand all lines: Doc/whatsnew/3.11.rst
+6Lines changed: 6 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,12 @@ Build Changes
604604
``isinf()``, ``isnan()``, ``round()``.
605605
(Contributed by Victor Stinner in :issue:`45440`.)
606606

607+
* Building Python now requires a C99 ``<math.h>`` header file providing
608+
a ``NAN`` constant, or the ``__builtin_nan()`` built-in function. If a
609+
platform does not support Not-a-Number (NaN), the ``Py_NO_NAN`` macro can be
610+
defined in the ``pyconfig.h`` file.
611+
(Contributed by Victor Stinner in :issue:`46640`.)
612+
607613
* Freelists for object structs can now be disabled. A new :program:`configure`
608614
option :option:`!--without-freelists` can be used to disable all freelists
609615
except empty tuple singleton.
Collapse file

‎Include/pymath.h‎

Copy file name to clipboardExpand all lines: Include/pymath.h
+10-21Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -51,29 +51,18 @@
5151
#endif
5252

5353
/* Py_NAN
54-
* A value that evaluates to a NaN. On IEEE 754 platforms INF*0 or
55-
* INF/INF works. Define Py_NO_NAN in pyconfig.h if your platform
56-
* doesn't support NaNs.
54+
* A value that evaluates to a quiet Not-a-Number (NaN).
55+
* Define Py_NO_NAN in pyconfig.h if your platform doesn't support NaNs.
5756
*/
5857
#if !defined(Py_NAN) && !defined(Py_NO_NAN)
59-
# if !defined(__INTEL_COMPILER)
60-
# define Py_NAN (Py_HUGE_VAL * 0.)
61-
# else /* __INTEL_COMPILER */
62-
# if defined(ICC_NAN_STRICT)
63-
#pragma float_control(push)
64-
#pragma float_control(precise, on)
65-
#pragma float_control(except, on)
66-
Py_NO_INLINE static double __icc_nan()
67-
{
68-
return sqrt(-1.0);
69-
}
70-
#pragma float_control (pop)
71-
# define Py_NAN __icc_nan()
72-
# else /* ICC_NAN_RELAXED as default for Intel Compiler */
73-
static const union { unsigned char buf[8]; double __icc_nan; } __nan_store = {0,0,0,0,0,0,0xf8,0x7f};
74-
# define Py_NAN (__nan_store.__icc_nan)
75-
# endif /* ICC_NAN_STRICT */
76-
# endif /* __INTEL_COMPILER */
58+
# if _Py__has_builtin(__builtin_nan)
59+
// Built-in implementation of the ISO C99 function nan(): quiet NaN.
60+
# define Py_NAN (__builtin_nan(""))
61+
#else
62+
// Use C99 NAN constant: quiet Not-A-Number.
63+
// NAN is a float, Py_NAN is a double: cast to double.
64+
# define Py_NAN ((double)NAN)
65+
# endif
7766
#endif
7867

7968
#endif /* Py_PYMATH_H */
Collapse file

‎Lib/cgi.py‎

Copy file name to clipboardExpand all lines: Lib/cgi.py
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
1414
This module defines a number of utilities for use by CGI scripts
1515
written in Python.
16+
17+
The global variable maxlen can be set to an integer indicating the maximum size
18+
of a POST request. POST requests larger than this size will result in a
19+
ValueError being raised during parsing. The default value of this variable is 0,
20+
meaning the request size is unlimited.
1621
"""
1722

1823
# History
Collapse file

‎Lib/re.py‎

Copy file name to clipboardExpand all lines: Lib/re.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,15 @@
137137
"findall", "finditer", "compile", "purge", "template", "escape",
138138
"error", "Pattern", "Match", "A", "I", "L", "M", "S", "X", "U",
139139
"ASCII", "IGNORECASE", "LOCALE", "MULTILINE", "DOTALL", "VERBOSE",
140-
"UNICODE",
140+
"UNICODE", "NOFLAG", "RegexFlag",
141141
]
142142

143143
__version__ = "2.2.1"
144144

145145
@enum.global_enum
146146
@enum._simple_enum(enum.IntFlag, boundary=enum.KEEP)
147147
class RegexFlag:
148+
NOFLAG = 0
148149
ASCII = A = sre_compile.SRE_FLAG_ASCII # assume ascii "locale"
149150
IGNORECASE = I = sre_compile.SRE_FLAG_IGNORECASE # ignore case
150151
LOCALE = L = sre_compile.SRE_FLAG_LOCALE # assume current 8-bit locale
Collapse file

‎Lib/test/support/__init__.py‎

Copy file name to clipboardExpand all lines: Lib/test/support/__init__.py
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,6 +1278,8 @@ def reap_children():
12781278
# Need os.waitpid(-1, os.WNOHANG): Windows is not supported
12791279
if not (hasattr(os, 'waitpid') and hasattr(os, 'WNOHANG')):
12801280
return
1281+
elif not has_subprocess_support:
1282+
return
12811283

12821284
# Reap all our dead child processes so we don't leave zombies around.
12831285
# These hog resources and might be causing some of the buildbots to die.
Collapse file

‎Lib/test/support/os_helper.py‎

Copy file name to clipboardExpand all lines: Lib/test/support/os_helper.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ def __fspath__(self):
502502
def fd_count():
503503
"""Count the number of open file descriptors.
504504
"""
505-
if sys.platform.startswith(('linux', 'freebsd')):
505+
if sys.platform.startswith(('linux', 'freebsd', 'emscripten')):
506506
try:
507507
names = os.listdir("/proc/self/fd")
508508
# Subtract one because listdir() internally opens a file

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.