Commit Graph

27128 Commits

Author SHA1 Message Date
Gregory P. Smith 59073c9ab8
gh-109096: Deprecate `http.server.CGIHTTPRequestHandler` (#109387)
Deprecate `http.server.CGIHTTPRequestHandler`.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-09-15 14:26:45 -07:00
Egil Martinsson 3d881453d3
gh-109350: Fix outdated captured output in unittest.mock documentation (#109353) 2023-09-15 19:25:16 +01:00
Hugo van Kemenade b434dd7e36
Docs: Superseded modules: list only module names (#109439) 2023-09-15 15:56:23 +03:00
Nikita Sobolev 21e80f4c19
gh-101100: Fix sphinx warnings in `turtle.rst` (#109394) 2023-09-14 14:24:18 -04:00
Victor Stinner d7a27e527d
gh-107298: Document PyMODINIT_FUNC macro (#109236)
Document PyMODINIT_FUNC macro.

Remove links to PyAPI_FUNC() and PyAPI_DATA() macros since they are
not documented. These macros should only be used to define the Python
C API. They should not be used outside Python code base.
2023-09-14 14:56:43 +02:00
Brandt Bucher 22e65eecaa
GH-105848: Replace KW_NAMES + CALL with LOAD_CONST + CALL_KW (GH-109300) 2023-09-13 10:25:45 -07:00
Oleksandr Kravets a0c06a4f93
Fix variable name in dis documentation example (GH-109343)
BINARY_SUBSCR example erroneously uses two different names `key` and `index` to refer to the same variable. STORE_SUBSCR and DELETE_SUBSCR use only `key` in the same context. Changing `index` to `key` for consistency.
2023-09-13 08:07:56 +03:00
Thomas Grainger 6c0ddca409
gh-105189: fix importlib.resources.abc deprecation docs (#105232)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-09-13 07:42:26 +03:00
Adam Turner 90cf345ed4
GH-104395: Add a link in 'Meta Information' to the docs download page (#104443)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-09-12 20:32:13 +00:00
Irit Katriel b303d3ad3e
gh-109319: deprecate dis.HAVE_ARGUMENT (#109320) 2023-09-12 16:45:35 +01:00
Irit Katriel 0e76cc359b
gh-109184: update traceback module doc w.r.t notes (message is no longer always at the end) (#109201) 2023-09-12 14:54:04 +00:00
AN Long e121fca33b
gh-109266: Fix msvcrt.kbhit's documented return value (GH-109267) 2023-09-12 15:44:48 +01:00
Irit Katriel 8b55adfa8f
gh-109256: allocate opcode IDs for internal opcodes in their own range (#109269) 2023-09-12 10:36:17 +00:00
Raymond Hettinger f2a55fecd0
Fix iter_index() to work with lists which do not support stop=None. (gh-109306) 2023-09-12 04:04:28 +02:00
Carl Meyer 2b1e2f1cd1
gh-109292: add symtable impact of PEP 709 to What's New (#109293) 2023-09-11 18:03:04 -06:00
wim glenn 1ee50e2a78
gh-107322: zipapp: Remove the suggestion to remove .dist-info directories (#107296)
Removed zipapp suggestion to rm .dist-info subdirectories. This totally breaks importlib.metadata
2023-09-11 15:44:13 -04:00
Hugo van Kemenade 57b6205523
gh-109190: What's New in 3.12: Add subheadings to removals for easy linking (#109159)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-09-11 19:06:16 +03:00
Delgan 2dd6a86c4e
Fix "FSTRING_MIDDLE" typo in py312 "What's New" (#109222) 2023-09-10 10:55:56 +00:00
Serhiy Storchaka 92578919a6
gh-109174: Add support of SimpleNamespace in copy.replace() (GH-109175) 2023-09-10 08:09:25 +03:00
Raymond Hettinger d3ed9921cd
Improve the sieve() recipe in the itertools docs (gh-109199)
Lazier sieve
2023-09-09 17:50:04 -05:00
Shantanu 74fc96bc60
Add version directives to ast docs (#108788) 2023-09-07 11:34:18 -07:00
Christoph Anton Mitterer 403ab1306a
gh-107924: re-order os.sendfile() flag documentation (#107926)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-09-07 18:50:10 +03:00
Mark Dickinson b72251de93
gh-102823: Document return type of floor division on floats (#102824)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-09-07 14:20:33 +00:00
Nikita Sobolev ac31f714c3
gh-107544: Add docs about `json.dumps(..., default=)` (#108259) 2023-09-07 06:53:33 -07:00
Stanley 891236f482
gh-71770: Add more details on behavior of configparser's default_section (#31562)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-09-07 13:52:58 +00:00
Colin Watson 1294fcede0
GH-90915: Document that SystemExit doesn't trigger sys.excepthook (#31357)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-09-07 13:14:27 +00:00
Ori Hoch 6b15ff5235
socket documentation fix - rename triple to 3-tuple (#24722)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-09-07 10:33:02 +00:00
Karthikeyan Singaravelan e183a71eef
bpo-38157: Add example about per file output for mock_open. (#16090)
Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-09-07 09:19:13 +00:00
Adam Turner f0f96a9f40
GH-108202: Document ``calendar``'s command-line interface (#109020)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-09-06 21:19:54 +00:00
Serhiy Storchaka 6f3c138dfa
gh-108751: Add copy.replace() function (GH-108752)
It creates a modified copy of an object by calling the object's
__replace__() method.

It is a generalization of dataclasses.replace(), named tuple's _replace()
method and replace() methods in various classes, and supports all these
stdlib classes.
2023-09-06 23:55:42 +03:00
Shahriar Heidrich 9f0c0a46f0
gh-107732: Mention dir support in importlib.resources docs (#107734)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-09-06 20:53:32 +00:00
Anthony Shaw f9bd6e49ae
GH-90690: Mention removal of ``PRECALL`` in What's New (#103910)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-09-06 20:28:00 +00:00
Victor Stinner db1ee6a19a
gh-108740: Fix "make regen-all" race condition (#108741)
Fix a race condition in "make regen-all". The deepfreeze.c source and
files generated by Argument Clinic are now generated or updated
before generating "global objects". Previously, some identifiers may
miss depending on the order in which these files were generated.

* "make regen-global-objects": Make sure that deepfreeze.c is
  generated and up to date, and always run "make clinic".
* "make clinic" no longer runs generate_global_objects.py script.
* "make regen-deepfreeze" now only updates deepfreeze.c (C file).
  It doesn't build deepfreeze.o (object) anymore.
* Remove misleading messages in "make regen-global-objects" and
  "make clinic". They are now outdated, these commands are now
  safe to use.
* Document generates files in Doc/using/configure.rst.

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-09-06 20:09:21 +02:00
Victor Stinner a0773b89df
gh-108753: Enhance pystats (#108754)
Statistics gathering is now off by default. Use the "-X pystats"
command line option or set the new PYTHONSTATS environment variable
to 1 to turn statistics gathering on at Python startup.

Statistics are no longer dumped at exit if statistics gathering was
off or statistics have been cleared.

Changes:

* Add PYTHONSTATS environment variable.
* sys._stats_dump() now returns False if statistics are not dumped
  because they are all equal to zero.
* Add PyConfig._pystats member.
* Add tests on sys functions and on setting PyConfig._pystats to 1.
* Add Include/cpython/pystats.h and Include/internal/pycore_pystats.h
  header files.
* Rename '_py_stats' variable to '_Py_stats'.
* Exclude Include/cpython/pystats.h from the Py_LIMITED_API.
* Move pystats.h include from object.h to Python.h.
* Add _Py_StatsOn() and _Py_StatsOff() functions. Remove
  '_py_stats_struct' variable from the API: make it static in
  specialize.c.
* Document API in Include/pystats.h and Include/cpython/pystats.h.
* Complete pystats documentation in Doc/using/configure.rst.
* Don't write "all zeros" stats: if _stats_off() and _stats_clear()
  or _stats_dump() were called.
* _PyEval_Fini() now always call _Py_PrintSpecializationStats() which
  does nothing if stats are all zeros.

Co-authored-by: Michael Droettboom <mdboom@gmail.com>
2023-09-06 15:54:59 +00:00
nabin2004 6f8411cfd6
gh-108857: improve markup in inspect.Signature.replace() docs (#108862) 2023-09-05 17:27:59 -07:00
wim glenn 9bf350b066
gh-107755: Document the correct default value of slice step (GH-107756)
Document the correct default value of slice step.
2023-09-05 21:22:27 +02:00
Nikita Sobolev ad1d6a1c20
gh-108903: Remove unneeded `lambda`s from `asyncio` (GH-108904) 2023-09-05 18:11:12 +03:00
Mark Shannon 8b515f60ee
GH-103082: Document PEP-669: Low Impact Monitoring for CPython (GH-107772) 2023-09-05 12:35:52 +01:00
Tian Gao 6304d983a0
gh-108463: Make expressions/statements work as expected in pdb (#108464) 2023-09-04 21:44:40 +00:00
Hugo van Kemenade 7855d325e6
Link to PEP sections in What's New in 3.12 (#108878) 2023-09-04 15:02:25 -06:00
Victor Stinner 03c4080c71
gh-108765: Python.h no longer includes <ctype.h> (#108831)
Remove <ctype.h> in C files which don't use it; only sre.c and
_decimal.c still use it.

Remove _PY_PORT_CTYPE_UTF8_ISSUE code from pyport.h:

* Code added by commit b5047fd019
  in 2004 for MacOSX and FreeBSD.
* Test removed by commit 52ddaefb6b
  in 2007, since Python str type now uses locale independent
  functions like Py_ISALPHA() and Py_TOLOWER() and the Unicode
  database.

Modules/_sre/sre.c replaces _PY_PORT_CTYPE_UTF8_ISSUE with new
functions: sre_isalnum(), sre_tolower(), sre_toupper().

Remove unused includes:

* _localemodule.c: remove <stdio.h>.
* getargs.c: remove <float.h>.
* dynload_win.c: remove <direct.h>, it no longer calls _getcwd()
  since commit fb1f68ed7c (in 2001).
2023-09-03 18:54:27 +02:00
Raymond Hettinger f373c6b948
gh-107208: Fix iter_index() recipe to not swallow exceptions (gh-108835)
gh-107208: iter_index now supports "stop" and no longer swallows ValueError
2023-09-02 22:25:13 -05:00
Victor Stinner e7de0c5901
gh-108765: Python.h no longer includes <sys/time.h> (#108775)
Python.h no longer includes <time.h>, <sys/select.h> and <sys/time.h>
standard header files.

* Add <time.h> include to xxsubtype.c.
* Add <sys/time.h> include to posixmodule.c and semaphore.c.
* readline.c includes <sys/select.h> instead of <sys/time.h>.
* resource.c no longer includes <time.h> and <sys/time.h>.
2023-09-02 17:51:19 +02:00
Victor Stinner 594b00057e
gh-108765: Python.h no longer includes <unistd.h> (#108783) 2023-09-02 16:50:18 +02:00
Victor Stinner 4f9b706c6f
gh-108794: doctest counts skipped tests (#108795)
* Add 'skipped' attribute to TestResults.
* Add 'skips' attribute to DocTestRunner.
* Rename private DocTestRunner._name2ft attribute
  to DocTestRunner._stats.
* Use f-string for string formatting.
* Add some tests.
* Document DocTestRunner attributes and its API for statistics.
* Document TestResults class.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-09-02 16:42:07 +02:00
Victor Stinner 4ba18099b7
gh-108765: Python.h no longer includes <ieeefp.h> (#108781)
Remove also the HAVE_IEEEFP_H macro: remove ieeefp.h from the
AC_CHECK_HEADERS() check of configure.ac.
2023-09-02 15:48:32 +02:00
Nikita Sobolev 5141b1ebe0
gh-101100: Fix sphinx warnings in `unittest.mock-examples.rst` (#108810) 2023-09-02 13:05:44 +01:00
Nikita Sobolev dd05c2054f
Fix typo in `uuid.rst` (#108809) 2023-09-02 10:08:46 +00:00
Nikita Sobolev 21da4980f5
gh-101100: Fix sphinx warnings in `uuid.rst` (#108805)
* gh-101100: Fix sphinx warnings in `uuid.rst`

* Use anchors
2023-09-02 09:32:19 +00:00
TATHAGATA ROY 8f9ea43ee8
gh-105563: reference DateType in datetime's documentation (#105946) 2023-09-01 13:36:24 -07:00