Commit Graph

28759 Commits

Author SHA1 Message Date
Adam Turner e7d465a607
GH-109975: Copyedit 3.13 What's New: Copyedit C API deprecations pending removal (#124336) 2024-09-23 19:40:20 +01:00
Adam Turner f3b2c36deb
GH-109975: Copyedit 3.13 What's New: Build Changes (#124343)
Co-authored-by: Malcolm Smith <smith@chaquo.com>
2024-09-23 11:30:45 -07:00
Adam Turner 2f6d4109b8
GH-109975: Copyedit 3.13 What's New: Porting to Python 3.13 (#124341)
Copyedit Porting to Python 3.13
2024-09-23 11:14:37 -07:00
decorator-factory 6203ef35dd
Replace the term `Immutable` with a `Hashable` in the `sequence` entry of the Glossary (#124350)
The term `Immutable` in the `sequence` entry of the glossary is used incorrectly, in fact dicts accepts hashable keys, which is not the same as immutable.
2024-09-23 16:34:08 +00:00
Adam Turner 9d0a75269c
GH-109975: Copyedit 3.13 What's New: C API (#124313) 2024-09-23 14:28:17 +01:00
Savannah Ostrowski 5f5c0b9c23
GH-79714: Add mention of stderr for clarity to ArgumentParser.exit() (GH-123932) 2024-09-23 12:08:03 +03:00
Y5 d3e79d75d1
gh-124130: Notes on empty string corner case of category `\B` (#124133)
Signed-off-by: y5c4l3 <y5c4l3@proton.me>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-09-23 08:58:14 +02:00
Jacob Walls 622368d99c
Fix typo in XMLParser doc (#124129) 2024-09-20 12:42:44 +02:00
Hugo van Kemenade 5f01111594
Docs: Update two FAQs for Python 3 (#124247)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-09-19 21:50:05 +03:00
Jakub Kulík 8f82d9aa21
bpo-41843: Reenable use of sendfile in shutil module on Solaris (GH-23893) 2024-09-19 14:47:05 +00:00
Zachary Ware 9a6e2336e4
Fix `make htmllive` target (GH-124219)
Allow `make -C Doc htmllive` to work without manual venv activation

Set PATH to ensure that `sphinx-autobuild` can find `sphinx-build`.
2024-09-18 21:02:20 +00:00
Tomas R 21d2a9ab2f
gh-116022: Improve `repr()` of AST nodes (#117046)
Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-09-18 10:28:22 -07:00
Petr Viktorin 32119fc377
gh-118915: Add/fix docs entries for some new 3.13 C API (GH-124134) 2024-09-18 14:15:43 +02:00
Sergey B Kirpichev 8a284e1896
gh-119771: Set errno on overflows in _Py_c_pow() (#120256)
Before we did this in complex_pow() and behavior of the public C API
function _Py_c_pow() was different from the pure-python pow().
2024-09-18 10:39:11 +02:00
neonene 646f16bdee
gh-124153: Implement `PyType_GetBaseByToken()` and `Py_tp_token` slot (GH-124163) 2024-09-18 09:18:19 +02:00
Bradley Reynolds d8c0fe1944
gh-124194: Fix wrong issue number in What's New in Python 3.8 (#124195)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-09-18 01:51:15 +01:00
Rafael Fontenelle ab80c6b402
GH-103484: Fix broken links reported by linkcheck (#124169) 2024-09-17 17:05:15 +02:00
Rafael Fontenelle 33eeccf6d4
Use pep role instead of url (#121611) 2024-09-17 16:02:14 +03:00
Rafael Fontenelle 0a32c6959c
GH-103484: Fix permanently redirects reported by linkcheck (GH-124144)
Fix redirects reported by linkcheck, update docs conf.py checks.
2024-09-17 02:53:38 +00:00
Adam Turner 05235e3c16
GH-109975: Copyedit 3.13 What's New: New Deprecations (#123845)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-09-16 17:03:46 +00:00
Chris Barker 38809171b8
gh-121607: Edited source file import recipe to make it more clear (#121519)
Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2024-09-13 16:36:40 -07:00
Raymond Hettinger cd06f5e323
Minor edits to the descriptor guide (GH-123928) 2024-09-13 17:02:37 -05:00
Oleg Iarygin 4f25e282ad
gh-100554: Fix formatting of type.rst modifications (#124066) 2024-09-13 18:35:08 +00:00
Wenzel Jakob 74330d992b
gh-100554: Add ``Py_tp_vectorcall`` slot to set ``PyTypeObject.tp_vectorcall`` using the ``PyType_FromSpec`` function family. (#123332) 2024-09-13 17:40:25 +02:00
utkonos bbb36c0934
Normalize cdecl formatting as found elsewhere on ctypes.rst (#121379) 2024-09-13 18:26:16 +03:00
Rafael Fontenelle 39612103dd
Update to 3.13 the output of exceptions raised (#123888) 2024-09-13 15:17:30 +00:00
Donghee Na e6bb1a2b28
gh-119802: Update memory management docs for free-threaded build (gh-124006)
* gh-119802: Update memory management docs for free-threaded build

* nit

* nit

* Address code review

* nit

* Update Doc/c-api/memory.rst

Co-authored-by: Sam Gross <colesbury@gmail.com>

---------

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-09-13 15:15:44 +00:00
Benjamin Peterson bb904e063d
closes gh-124016: update Unicode to 16.0.0 (#124017) 2024-09-13 07:47:04 -07:00
Petr Viktorin 432bf31327
gh-123909: PyType_From*: Disallow metaclasses with custom tp_new (GH-123947) 2024-09-13 13:18:49 +02:00
Savannah Ostrowski e5b0185e43
GH-101599: Update docs to remove redundant option in argparse tutorial (#124025) 2024-09-13 09:14:52 +03:00
Yngve Mardal Moe 584cdf8d41
gh-123614: Add save function to turtle.py (#123617) 2024-09-12 21:36:17 -07:00
Jason R. Coombs a47cd21890
gh-123976: Refresh docs around custom providers. (#123977)
* gh-123976: Refresh docs around custom providers.

* Remove excess whitespace.
2024-09-13 02:29:08 +00:00
Nice Zombies 8e99495701
gh-118577: Clarify that inspect.BoundArguments prefers to put values in args (GH-119936) 2024-09-12 14:03:32 +02:00
Hugo van Kemenade f5597dbd0e
Docs: Drop letter PDF (#123912) 2024-09-12 13:49:19 +03:00
Irit Katriel 77c68b40d5
gh-111997: update what's new in 3.13 re C API for monitoring events (#123822) 2024-09-12 11:32:57 +01:00
sobolevn 3bd942f106
Fix "The Matrix" movie release year in `typing.rst` (#123965) 2024-09-11 21:25:23 +03:00
Hugo van Kemenade eb169f4027
Update Sphinx Lint and fix unnecessary parentheses in `:func:`s (#123960) 2024-09-11 21:05:15 +03:00
Irit Katriel e07154fd1e
gh-123958: apply docstring removal optimization in ast_opt instead of codegen (#123959) 2024-09-11 17:02:28 +00:00
Bénédikt Tran ef05801ba0
gh-108951: Document how to terminate an asyncio.TaskGroup (#123837)
We don't want to add another API, since the recipe is straightforward and rarely needed.

The advantage is that we could backport this to the earliest Python version that has taskgroups (3.11, alas in security mode already, so we'll just do 3.12 and 3.13).
2024-09-11 08:43:24 -07:00
Jelle Zijlstra 5436d8b9c3
gh-119180: Documentation for PEP 649 and 749 (#122235)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-09-11 07:49:59 -07:00
Tushar Sadhwani 3597642ed5
gh-122239: Add actual count in unbalanced unpacking error message when possible (#122244) 2024-09-10 16:07:30 +01:00
Bénédikt Tran 07f0bf5aa4
gh-123165: update docs signature for `dis.disassemble` (#123808) 2024-09-10 15:25:27 +01:00
Petr Viktorin 1b29f4144c
gh-123905: Update TOML description to include version number (GH-123906)
Update TOML description to include version number

There is some movement, currently blocked, that would update the TOML spec to 1.1.0; this would include breaking changes to what characters are allowed. Thus, it is worthwhile for the library page to be clear which version is implemented here.

Co-authored-by: Paul Hoffman <phoffman@proper.com>
2024-09-10 14:16:32 +00:00
Peter Bierma 962304a54c
gh-123609: Clarify usage of standalone `PyBUF_FORMAT` (GH-123778) 2024-09-10 15:05:28 +02:00
Raymond Hettinger 2afba5ca6d
Small improvements to the itertools docs (GH-123885) 2024-09-09 20:57:49 -05:00
Anthony Sottile d359a7683e
gh-66449: remove duplicate configparser section in 3.13 whatsnew (#123874) 2024-09-09 16:40:18 -04:00
Serhiy Storchaka c0c2aa7644
gh-122213: Add notes for pickle serialization errors (GH-122214)
This allows to identify the source of the error.
2024-09-09 21:28:55 +03:00
sobolevn b950831c94
Mention `curl` in `contextvars` docs (#123838) 2024-09-09 16:58:49 +03:00
Bénédikt Tran 32bc2d6141
gh-123834: Add `symtable` to the list of modules with a CLI (#123835) 2024-09-09 13:45:43 +02:00
Donghee Na aa3f11f80a
gh-108219: Add credits to the free-threading entry in What's New (#123802)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Itamar Oren <itamarost@gmail.com>
2024-09-08 21:20:15 +01:00
Wulian beee91cdcc
gh-123789: `secrets.randbits` returns only non-negative int (#123801) 2024-09-07 21:17:59 -07:00
Wei-Hsiang (Matt) Wang 93050e4614
Remove excessive backticks in logging doc (#123813) 2024-09-07 18:09:02 +00:00
Nathan Goldbaum 5a4fb7ea1c
gh-109975: Add links to py-free-threading.github.io (#123776)
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-09-06 20:12:12 +03:00
Stanislav Terliakov 56e4a417ce
gh-123523: Rework typing documentation for generators and coroutines, and link to it from `collections.abc` docs (#123544) 2024-09-06 17:41:06 +01:00
Victor Stinner d343f977ba
gh-121645: Fix typo in PyBytes_Join() doc (#123783) 2024-09-06 16:08:17 +02:00
David Caron 67957ea77d
gh-103066: Add links and `help` in site.py constants (#103777)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-09-06 10:29:28 +03:00
Peter Bierma 84ad264ce6
gh-123275: Support `-Xgil=1` and `PYTHON_GIL=1` on non-free-threaded builds (gh-123276) 2024-09-06 08:53:47 +09:00
nkinnan b5aa271f86
gh-123476: Add support for TCP_QUICKACK socket setting to Windows (#123478)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2024-09-05 22:59:48 +02:00
Rafael Fontenelle 6e43928831
Swap the and from in sentence in init_config.rst (#120086) 2024-09-05 23:04:15 +03:00
edson duarte 9aea9c100f
gh-85453: Improve instance attributes mark up on datetime.rst (#123655)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-09-05 20:56:52 +03:00
Pieter Eendebak 327463aef1
gh-123207: Clarify the documentation for the mro lookup for super() (GH-123417) 2024-09-05 15:52:04 +02:00
Petr Viktorin 16be8db6be
gh-123465: Allow Py_RELATIVE_OFFSET for __*offset__ members (GH-123474) 2024-09-05 14:14:05 +02:00
Nice Zombies c530ce1e9d
gh-118710: Make IPv*Address.version & max_prefixlen available on the class (GH-120698) 2024-09-04 15:51:12 +02:00
Victor Stinner 0d6b6e34a2
gh-107954, PEP 741: Add PyInitConfig_AddModule() function (#123668) 2024-09-04 11:41:57 +00:00
Alexander Bessman 7d2c2f24da
gh-123463: Include logging_flow diagram in non-HTML docs (GH-123464) 2024-09-04 13:14:36 +02:00
ryan-duve c08ede2714
gh-123392: Clarify wording regarding parameters that are functions to be called (GH-123394) 2024-09-04 11:05:46 +00:00
Lipták Attila (Flash) cfbc841ef3
gh-123621: Fix `datamodel.rst` with proper `dict` notation (#123648) 2024-09-03 22:52:00 +03:00
Shaygan Hooshyari 68fe5758bf
gh-123579: Document exclamation token (#123612) 2024-09-03 16:49:38 +02:00
Victor Stinner ef9d54703f
gh-107954, PEP 741: Add PyInitConfig C API (#123502)
Add Doc/c-api/config.rst documentation.
2024-09-03 12:33:49 +00:00
CBerJun 9e079c220b
gh-123580: Fix `signed_number` token in documentation (GH-123582)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2024-09-03 10:01:26 +02:00
Yorik Hansen 9684f40b9f
gh-123430: Add dark mode support to pages generated by http.server (#123475)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-09-03 09:32:11 +03:00
Victor Stinner 33b790978d
gh-107954, PEP 741: Add PyConfig_Get()/Set() functions (#123472)
Add PyConfig_Get(), PyConfig_GetInt(), PyConfig_Set() and
PyConfig_Names() functions to get and set the current runtime Python
configuration.

Add visibility and "sys spec" to config and preconfig specifications.

_PyConfig_AsDict() now converts PyConfig.xoptions as a dictionary.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-09-02 23:25:08 +02:00
Nice Zombies 22fdb8cf89
gh-118508: Clarify which characters are matched by `\s` (#119155)
Clarify re syntax
2024-09-02 07:48:15 -04:00
sobolevn c3ed775899
gh-123570: Add link to `weakref.ref` from `weakref_slot` docs in `dataclasses` (#123571) 2024-09-02 09:58:38 +03:00
Rafael Fontenelle 9a32a2588e
gh-109975: Remove dangling angle bracket from 3.13.rst (#123589)
Remove dangling angle bracket from 3.13.rst
2024-09-02 07:57:56 +03:00
Raymond Hettinger e3f76e5cfb
Remove irrelevant detail from example code. (gh-123587) 2024-09-01 20:04:33 -05:00
Raymond Hettinger cb6d25011e
Simplify Property() recipe to focus on the essentials (gh-123585) 2024-09-01 17:49:38 -05:00
sobolevn 75e72822a3
gh-91126: Docs and tests for slotted dataclasses with `__init_subclass__` (#123342) 2024-09-01 13:25:34 +03:00
jlallas384 bac0e115b8
gh-123550: Fix code snippet of `BUILD_TUPLE` in `dis` docs (#123551) 2024-09-01 07:11:40 +01:00
Adam Turner 0ff59d707c
GH-109975: Copyedit 3.13 What's New: Removals (#123529)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-09-01 05:41:17 +00:00
Aarni Koskela 0b6acfee04
gh-123494: Improve documentation for ``webbrowser`` return types (#123495)
Document the return value for ``webbrowser.open*()``.
2024-09-01 06:17:03 +01:00
Wei-Hsiang (Matt) Wang cf472577e2
gh-123517: Remove unnecessary ``:meth:`` parentheses (#123518) 2024-09-01 05:59:42 +01:00
Maciej Olko 5332d989af
gh-123407: Enable translating literal and code blocks (#123408) 2024-08-31 07:31:36 +01:00
Victor Stinner d8e69b2c1b
gh-122854: Add Py_HashBuffer() function (#122855) 2024-08-30 15:42:27 +00:00
Victor Stinner 3d60dfbe17
gh-121645: Add PyBytes_Join() function (#121646)
* Replace _PyBytes_Join() with PyBytes_Join().
* Keep _PyBytes_Join() as an alias to PyBytes_Join().
2024-08-30 12:57:33 +00:00
Wei-Hsiang (Matt) Wang 103a0470e3
gh-123492: Remove unnecessary `:func:` parentheses (#123493) 2024-08-30 14:34:09 +03:00
Bénédikt Tran 40fff90ae3
gh-101860: document `property.__name__` (GH-123399) 2024-08-28 16:10:13 +02:00
Wulian 9e108b8719
Fix typos in docs, error messages and comments (#123336)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-08-28 14:41:04 +03:00
Victor Stinner 4c6dca8292
gh-120389: Add PyLong_FromInt64() and PyLong_AsInt64() (#120390)
Add new functions to convert C <stdint.h> numbers from/to Python int:

* PyLong_FromInt32()
* PyLong_FromUInt32()
* PyLong_FromInt64()
* PyLong_FromUInt64()
* PyLong_AsInt32()
* PyLong_AsUInt32()
* PyLong_AsInt64()
* PyLong_AsUInt64()
2024-08-28 10:16:13 +00:00
sobolevn 6f563e364d
gh-123254: Improve `tuple` C API docs with more info about errors (#123255)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2024-08-28 10:30:21 +03:00
Daniel Hollas 08c0166ce4
gh-109975: Fix a typo in What's New in Python 3.13 (#123393) 2024-08-27 15:53:45 +01:00
Mark Shannon f49a91648a
GH-117759: Document incremental GC (GH-123266)
* Update what's new

* Update gc module docs and fix inconsistency in gc.get_objects
2024-08-27 15:23:39 +01:00
Petr Viktorin 6754566a51
gh-120426: Reword the glossary term "immortal" (GH-123191)
Reword the glossary term "immortal", mark it as an implementation detail
2024-08-27 13:37:56 +02:00
Barney Gale 7bd6ebf696
GH-73991: Prune `pathlib.Path.copy()` and `copy_into()` arguments (#123337)
Remove *ignore* and *on_error* arguments from `pathlib.Path.copy[_into]()`,
because these arguments are under-designed. Specifically:

- *ignore* is appropriated from `shutil.copytree()`, but it's not clear
  how it should apply when the user copies a non-directory. We've changed
  the callback signature from the `shutil` version, but I'm not confident
  the new signature is as good as it can be.
- *on_error* is a generalisation of `shutil.copytree()`'s error handling,
  which is to accumulate exceptions and raise a single `shutil.Error` at
  the end. It's not obvious which solution is better.

Additionally, this arguments may be challenging to implement in future user
subclasses of `PathBase`, which might utilise a native recursive copying
method.
2024-08-26 17:05:34 +01:00
Barney Gale 033d537cd4
GH-73991: Make `pathlib.Path.delete()` private. (#123315)
Per feedback from Paul Moore on GH-123158, it's better to defer making
`Path.delete()` public than ship it with under-designed error handling
capabilities.

We leave a remnant `_delete()` method, which is used by `move()`. Any
functionality not needed by `move()` is deleted.
2024-08-26 16:26:34 +01:00
Barney Gale c68a93c582
GH-73991: Add `pathlib.Path.copy_into()` and `move_into()` (#123314)
These two methods accept an *existing* directory path, onto which we join
the source path's base name to form the final target path.

A possible alternative implementation is to check for directories in
`copy()` and `move()` and adjust the target path, which is done in several
`shutil` functions. This behaviour is helpful in a shell context, but
less so in a stored program that explicitly specifies destinations. For
example, a user that calls `Path('foo.py').copy('bar.py')` might not
imagine that `bar.py/foo.py` would be created, but under the alternative
implementation this will happen if `bar.py` is an existing directory.
2024-08-26 14:14:23 +01:00
CF Bolz-Tereick 70bfef52b5
gh-82378: Document the difference between sys.tracebacklimit and the limit arguments (#123286) 2024-08-25 23:50:43 +01:00
Kirill Podoprigora 249b083ed8
gh-122982: Extend the deprecation period for bool inversion by two years (#123306) 2024-08-25 12:24:44 -07:00
Barney Gale 625d0705b9
GH-73991: Add `pathlib.Path.move()` (#122073)
Add a `Path.move()` method that moves a file or directory tree, and returns a new `Path` instance pointing to the target.

This method is similar to `shutil.move()`, except that it doesn't accept a *copy_function* argument, and it doesn't check whether the destination is an existing directory.
2024-08-25 16:51:51 +01:00
Adam Turner 74ff496dce
GH-109975: Copyedit 3.13 What's New: Optimizations (#123301) 2024-08-25 16:17:46 +03:00
Adam Turner 9b3749849e
GH-123299: Move ctypes What's New entry to 3.14 (#123300) 2024-08-25 01:41:44 +01:00
Adam Turner 127660bcdb
GH-109975: Copyedit 3.13 What's New: Improved Modules (#123132)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2024-08-24 14:32:35 +01:00
Adam Turner b178beef26
Docs: Fix Makefile syntax (#123287) 2024-08-24 12:57:38 +00:00
Bar Harel 90b6d0e0f8
gh-123213: Fixed xml.etree.ElementTree.Element.extend and assignment to no longer hide exceptions (GH-123214) 2024-08-23 12:12:58 +03:00
Bénédikt Tran b1d3bd2e09
gh-123165: make `dis` functions render positions on demand (#123168) 2024-08-21 14:46:24 +01:00
Peter Bierma 9dbd123755
gh-123084: Turn `shutil.ExecError` into a deprecated alias of `RuntimeError` (#123125) 2024-08-21 00:39:24 +00:00
Jelle Zijlstra 0480052ea1
gh-109975: Copyedit What's New in Python 3.13 (#123150)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-08-19 23:51:37 +00:00
Pedro Lacerda be257c5815
gh-123049: configparser: Allow to create the unnamed section from scratch. (#123077)
---------

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-08-18 15:52:25 -04:00
Sergey B Kirpichev b0f462d4c8
gh-123110: correct note about _Bool in the struct module docs (GH-123111) 2024-08-18 16:58:58 +03:00
Adam Turner 79c542b5cc
Docs: Run ``latexmk`` in parallel when creating PDFs (#123113) 2024-08-17 20:58:06 +00:00
Adam Turner d60b97a833
GH-109975: Copyedit 3.13 What's New: Other Language Changes (#123086)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-08-17 12:09:42 +00:00
Sergey B Kirpichev ce4b9c8464
gh-121477: mention new PyLong_*Bytes() functions in PyLong_FromString() (#121478)
* gh-121477: mention new PyLong_*Bytes() functions in PyLong_FromString()

* Update Doc/c-api/long.rst

---------

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-08-17 09:13:31 +00:00
mathysEthical e9287ea426
fix typo in dis.rst (#121612) 2024-08-17 14:20:58 +05:30
Rafael Fontenelle 26de1b245e
Remove unneeded verb in the phrase in sys.rst (#122718) 2024-08-17 14:18:31 +05:30
Damien 8a59deca59
gh-122519: Adding socket module shutdown() constants description (#122543) 2024-08-17 13:59:23 +05:30
CF Bolz-Tereick a07cf4ce25
mention pypy somewhat more prominently in the pyrepl section of whatsnew (#123063) 2024-08-16 11:38:44 +00:00
Eddie Elizondo 3203a74129
gh-113190: Reenable non-debug interned string cleanup (GH-113601) 2024-08-15 11:55:09 +00:00
Adam Turner b106cf8d97
GH-109975: Copyedit 3.13 What's New: New Features (#122990)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2024-08-15 10:08:15 +01:00
Rafael Fontenelle 1054a755a3
GH-103484: Tell linkcheck to ignore debian manpage redirects (#123019) 2024-08-14 22:35:23 +01:00
Damien 8e2dc7f380
gh-123005: Add version added in enum.Flag.__len__ (GH-123007) 2024-08-14 13:30:33 -07:00
Rafael Fontenelle 315a933a5b
Fix doctrees directory for the gettext builder (#122997) 2024-08-14 11:38:29 +01:00
Trey Hunner 906b796af8
gh-122873: Allow "python -m json" to work (#122884)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
2024-08-13 17:09:38 +01:00
Adam Turner db6f5e1933
GH-109975: Copyedit 3.13 What's New: Release Highlights (#122958)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-08-13 15:30:59 +01:00
Damien be90648fb2
gh-122944: Fix incorrect prompt strings in the Python Tutorial (#122949)
In the REPL, top level comments are followed by a primary, not secondary prompt.
Fix the places in the in the tutorial that use the latter.
2024-08-12 14:30:08 -04:00
Barney Gale a6644d4464
GH-73991: Rework `pathlib.Path.copytree()` into `copy()` (#122369)
Rename `pathlib.Path.copy()` to `_copy_file()` (i.e. make it private.)

Rename `pathlib.Path.copytree()` to `copy()`, and add support for copying
non-directories. This simplifies the interface for users, and nicely
complements the upcoming `move()` and `delete()` methods (which will also
accept any type of file.)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-08-11 22:43:18 +01:00
sobolevn ea70439bd2
gh-122701: Fix wording of raw strings/bytes in `lexical_analysis.rst` (#122702)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-08-11 21:02:50 +00:00
Rafael Fontenelle db8b83c2b0
Docs: Standardise versionchanged text in weakref.rst (#122898) 2024-08-11 21:40:11 +01:00
Wulian bc9d92c679
gh-122858: Deprecate `asyncio.iscoroutinefunction` (#122875)
Deprecate `asyncio.iscoroutinefunction` in favor of `inspect.iscoroutinefunction`.

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-08-11 16:35:51 +00:00
Barney Gale 363374cf69
GH-120794: Use example paths with multiple parts in pathlib docs (#122887)
In the documentation of `PosixPath` and `WindowsPath`, and their `Pure*`
equivalents, use example paths with multiple non-anchor parts.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-08-10 21:21:17 +00:00
Adam Turner 0959142e4d
gh-122868: Add more lower bounds for sphinxcontrib dependencies (#122891) 2024-08-10 20:50:43 +00:00
Nico Mexis 5580f31c56
gh-115808: Add ``is_none`` and ``is_not_none`` to ``operator`` (#115814)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-08-10 20:16:34 +01:00
Adam Turner 0fd97e46c7
gh-122868: Add lower bounds for sphinxcontrib dependencies (#122870)
* Docs: Add lower bounds for sphinxcontrib dependencies

* oops
2024-08-10 01:18:46 +03:00
Victor Stinner d3239976a8
gh-105376: Restore deprecated logging warn() method (#122775)
This reverts commit dcc028d924 and
commit 6c54e5d721.

Keep the deprecated logging warn() method in Python 3.13.

Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-08-09 15:13:24 +02:00
Nate Ohlson aab18f4d92
gh-112301: Update documentation for configure options (``--disable-safety`` and ``--enable-slower-safety``) (#122758)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-08-08 20:35:00 +01:00
Erlend E. Aasland e006c7371d
gh-105201: Add PyIter_NextItem() (#122331)
Return -1 and set an exception on error; return 0 if the iterator is
exhausted, and return 1 if the next item was fetched successfully.

Prefer this API to PyIter_Next(), which requires the caller to use
PyErr_Occurred() to differentiate between iterator exhaustion and errors.

Co-authered-by: Irit Katriel <iritkatriel@yahoo.com>
2024-08-08 00:47:15 +02:00
smij720 967a4f1d18
Docs: Change `remove` to `removes` for consistency (#121072) 2024-08-07 16:30:00 +01:00
Wim Jeantine-Glenn c25898d51e
Doc: cmdline.rst: Include -P and -R in usage (#122590)
* ``-P``: safe path (https://docs.python.org/3/using/cmdline.html#cmdoption-P)
* ``-R``: hash randomization (https://docs.python.org/3/using/cmdline.html#cmdoption-R)
2024-08-07 16:01:44 +01:00
Bénédikt Tran 76bdeebef6
gh-122511: Improve documentation for object identity of mutable/immutable types (#122512)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-08-07 13:40:19 +00:00
Barney Gale 98dba73010
GH-73991: Rework `pathlib.Path.rmtree()` into `delete()` (#122368)
Rename `pathlib.Path.rmtree()` to `delete()`, and add support for deleting
non-directories. This simplifies the interface for users, and nicely
complements the upcoming `move()` and `copy()` methods (which will also
accept any type of file.)
2024-08-07 01:34:44 +01:00
Sam Gross 1429651a06
gh-121103: Update site module docs for free-threaded installs (#122737)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-08-06 14:34:34 -04:00
Kirill Podoprigora 8ce70d6c69
gh-122058: `Lib/inspect`: Update docstrings for `isfunction`, `isgenerator`, `isframe`, `iscode`. (#122059)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-08-06 14:47:31 +02:00
Irit Katriel 1422500d02
gh-121367: [doc] BUILD_TUPLE arg can be 0 (#122663) 2024-08-05 10:17:55 +01:00
Libor Martínek f5c39b3e9c
gh-122661: Remove GNU make-specific directive from Doc/Makefile (#122662) 2024-08-04 17:02:29 +03:00
sobolevn 151934a324
gh-122623: Improve `c-api/bytearray.rst` with error handling info (#122624) 2024-08-04 00:55:47 +03:00
Adam Turner 95f5c89b54
GH-121970: Fix ``gettext`` for audit events (#122651) 2024-08-03 17:41:26 +01:00
scottwoodall 06eb9701a1
Doc: Grammar fix in ``library/ssl.rst``, 'Verifying certificates' (#122646) 2024-08-03 14:24:29 +01:00
Sergey B Kirpichev d91ac525ef
gh-122613: Document PyLong_GetInfo() (part of Limited API) (GH-#122280) 2024-08-03 13:20:10 +02:00
Matth-M 7a5c4103b0
Doc: Improve wording of ``os.path.commonpath()`` (#122627)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-08-03 11:18:59 +00:00
Irit Katriel 498376d7a7
gh-122445: populate only modified fields in __static_attributes__ (#122446) 2024-08-02 15:40:42 +01:00
Bénédikt Tran fb864c76cd
gh-121723: Relax constraints on queue objects for `logging.handlers.QueueHandler`. (GH-122154) 2024-08-02 12:16:32 +01:00
Victor Stinner addbb73927
Update PyObject_Del() documentation (#122597)
Replace PyMem_Del() with PyMem_Free().
2024-08-02 12:13:33 +02:00
Victor Stinner fda6bd842a
Replace PyObject_Del with PyObject_Free (#122453)
PyObject_Del() is just a alias to PyObject_Free() kept for backward
compatibility. Use directly PyObject_Free() instead.
2024-08-01 14:12:33 +02:00
Bénédikt Tran 88030861e2
gh-122555: Remove removed functions from `Doc/data/refcounts.dat` (#122556) 2024-08-01 12:26:09 +02:00
Rafael Fontenelle 58ffc4cf4a
gh-122384: Mark strings from Download page for translation (#122385)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-08-01 12:25:16 +03:00
jianghuyiyuan 46f5a4f9e1
Fix typos in docs, error messages and comments (#122502)
Signed-off-by: jianghuyiyuan <shuangcui@live.com>
2024-08-01 00:26:09 +00:00
Hugo van Kemenade d01fd24051
Docs: bump Sphinx to 8.0 and update constraints (#122496)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-07-31 07:02:08 +00:00
Cody Maloney a9344cdffa
gh-121381 Remove subprocess._USE_VFORK escape hatch (#121383)
This flag was added as an escape hatch in gh-91401 and backported to
Python 3.10. The flag broke at some point between its addition and now.
As there is currently no publicly known environments that require this,
remove it rather than work on fixing it.

This leaves the flag in the subprocess module to not break code which
may have used / checked the flag itself.

discussion: https://discuss.python.org/t/subprocess-use-vfork-escape-hatch-broken-fix-or-remove/56915/2
2024-07-30 18:39:54 -07:00
Petr Viktorin 0976339818
gh-121650: Encode newlines in headers, and verify headers are sound (GH-122233)
## Encode header parts that contain newlines

Per RFC 2047:

> [...] these encoding schemes allow the
> encoding of arbitrary octet values, mail readers that implement this
> decoding should also ensure that display of the decoded data on the
> recipient's terminal will not cause unwanted side-effects

It seems that the "quoted-word" scheme is a valid way to include
a newline character in a header value, just like we already allow
undecodable bytes or control characters.
They do need to be properly quoted when serialized to text, though.


## Verify that email headers are well-formed

This should fail for custom fold() implementations that aren't careful
about newlines.


Co-authored-by: Bas Bloemsaat <bas@bloemsaat.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-07-31 00:19:48 +02:00
Thomas Grainger c68cb8e0c9
Remove outdated note about instance methods from datamodel.rst (#122471) 2024-07-30 12:42:25 -07:00
Petr Viktorin 3833d27f98
gh-105733: Soft-deprecate ctypes.ARRAY, rather than hard-deprecating it. (GH-122281)
Soft-deprecate ctypes.ARRAY, rather than hard-deprecating it.

Partially reverts 2211454fe2
2024-07-30 09:37:58 +02:00
Adam Turner 11ad731f4f
GH-121970: Extract ``audit_events`` into a new extension (#122325) 2024-07-30 03:49:00 +00:00
Adam Turner 76bdfa4cd0
GH-122085: Use include files for C API deprecations (#109843) 2024-07-29 22:20:40 +01:00
Hugo van Kemenade aa449cf063
gh-122085: Create dedicated page for deprecations (#122352)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-07-28 10:53:21 +03:00
Barney Gale cbac8a3888
GH-121462: pathlib docs: improve table of corresponding os/os.path functions (#121465)
Re-order table of corresponding functions with the following priorities:

1. Pure functionality is at the top
2. `os.path` functions are shown before `os` functions
3. Similar functionality is kept together
4. Functionality follows docs order where possible

Add a few missed correspondences:

- `os.path.isjunction` and `Path.is_junction`
- `os.path.ismount` and `Path.is_mount`
- `os.lstat()` and `Path.lstat()`
- `os.lchmod()` and `Path.lchmod()`

Also add footnotes describing a few differences.
2024-07-27 18:03:18 +01:00
Hugo van Kemenade 4e75509349
gh-122085: Use include files for `whatsnew/3.14.rst` deprecations (#122242) 2024-07-27 14:17:54 +03:00
Adam Turner 762e771cc0
Fix underline for 'pty' in What's New in Python 3.14 (#122337) 2024-07-27 01:00:56 +00:00
Subrahmanya Gaonkar d52726ccd4
Document ``mimetypes.MimeTypes.add_type()`` (#122301)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-07-26 22:03:08 +00:00
Carol Willing 33586d64ca
Remove reference to docs mailing list for bug reports (#122323) 2024-07-26 13:56:39 -07:00
Pablo Galindo Salgado db2d8b6db1
gh-122300: Preserve AST nodes for format specifiers with single elements (#122308) 2024-07-26 16:29:41 +00:00
WilliamRoyNelson dcafb362f7
gh-121999: Change default tarfile filter to 'data' (GH-122002)
Co-authored-by: Tomas R <tomas.roun8@gmail.com>
Co-authored-by: Scott Odle <scott@sjodle.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-07-26 16:34:13 +02:00
Irit Katriel bc94cf7e25
gh-122245: move checks for writes and shadowing of __debug__ to symtable (#122246) 2024-07-26 14:39:56 +01:00
Mark Shannon 2c42e13e80
GH-116090: Fix test and clarify behavior for exception events when exhausting a generator. (GH-120697) 2024-07-26 14:37:35 +01:00
Mark Shannon 2e14a52cce
GH-122160: Remove BUILD_CONST_KEY_MAP opcode. (GH-122164) 2024-07-25 16:24:29 +01:00
Hugo van Kemenade b3b7b7d46a
gh-122085: Use include files for `whatsnew/3.12.rst` deprecations (#122093) 2024-07-24 02:29:35 -06:00
Jelle Zijlstra 7b7b90d1ce
gh-119180: Add `annotationlib` module to support PEP 649 (#119891)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-07-23 21:16:50 +00:00
Serhiy Storchaka e6b25e9a09
gh-122163: Add notes for JSON serialization errors (GH-122165)
This allows to identify the source of the error.
2024-07-23 20:02:54 +03:00
Ville Skyttä 498cb6dff1
Docs: Use cross-reference to `os.uname` in `sysconfig.get_platform` (#122083) 2024-07-23 14:08:39 +01:00
Adam Turner 53e9e7de63
GH-121970: Remove ``escape4chm`` (#122065) 2024-07-23 13:30:06 +01:00
Donghee Na a9bb3c7b3b
gh-121996: Introduce --disable-safety and --enable-slower-safety options (#122054)
* gh-121996: Introduce --disable-safty and --enable-slower-safty

* Update GA

* fix

* Address code review

* Update CI
2024-07-23 09:22:04 +09:00
Jelle Zijlstra 2762c6cc5e
gh-121637: Syntax error for optimized-away incorrect await (#121656)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-07-22 14:12:43 -07:00
Bénédikt Tran c09d4c4a26
gh-119698: deprecate ``symtable.Class.get_methods`` (#121902) 2024-07-22 07:04:17 -07:00
Łukasz Langa dc93d1125f
gh-121957: Emit audit events for `python -i` and `python -m asyncio` (GH-121958)
Relatedly, emit the `cpython.run_startup` event from the Python version of
`PYTHONSTARTUP` handling.
2024-07-22 13:04:08 +02:00
Ville Skyttä bc264eac3a
Docs: spelling and grammar fixes (#122084)
Corrected some grammar and spelling issues in documentation.

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-07-22 09:14:25 +08:00
Russell Keith-Magee 728432c804
gh-120522: Apply App Store compliance patch during installation (#121947)
Adds a --with-app-store-compliance configuration option that patches out code known to be an issue with App Store review processes. This option is applied automatically on iOS, and optionally on macOS.
2024-07-22 07:36:08 +08:00
Andrey Mishchenko 0dcbc83853
Delete stale note about mp.Lock.acquire/SIGINT (#120929) 2024-07-21 06:17:57 +00:00
Raymond Hettinger ebc18abbf3
gh-121977: Add tips for handling unhashable data (#122075) 2024-07-21 05:53:26 +00:00
Barney Gale c4c7097e64
GH-73991: Support preserving metadata in `pathlib.Path.copytree()` (#121438)
Add *preserve_metadata* keyword-only argument to `pathlib.Path.copytree()`,
defaulting to false. When set to true, we copy timestamps, permissions,
extended attributes and flags where available, like `shutil.copystat()`.
2024-07-20 23:32:52 +01:00
Barney Gale 094375b9b7
GH-73991: Add `pathlib.Path.rmtree()` (#119060)
Add a `Path.rmtree()` method that removes an entire directory tree, like
`shutil.rmtree()`. The signature of the optional *on_error* argument
matches the `Path.walk()` argument of the same name, but differs from the
*onexc* and *onerror* arguments to `shutil.rmtree()`. Consistency within
pathlib is probably more important.

In the private pathlib ABCs, we add an implementation based on `walk()`.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-07-20 20:14:13 +00:00
Adam Turner 8db5f48007
Docs: Fix duplicate object description warnings (#122068) 2024-07-20 19:46:41 +00:00
Adam Turner b7ad711fcb
GH-121970: Modernise the patchlevel extension (#121995) 2024-07-20 13:44:43 +00:00
Rafael Fontenelle 3de092b82f
Docs: Fix a typo in What's New in Python 3.13 (#122051) 2024-07-20 04:46:57 +01:00
Rodrigo Oliveira d66b06107b
gh-118830: Bump pickle.DEFAULT_PROTOCOL to 5 (GH-119340) 2024-07-19 16:47:10 +02:00
Hugo van Kemenade a1df1b4439
Docs: move deprecations into include files (#121241) 2024-07-19 07:57:14 -06:00
Petr Viktorin 709db44255
gh-121160: Note that readline libraries using different history formats. (GH-121327)
This is not something we can do too much about, without help from the
underlying libraries.
2024-07-19 15:52:00 +02:00
Adam Turner 22c9d9c1fc
GH-121970: Rewrite the C-API annotations extension (#121985)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-07-19 12:21:56 +00:00
Adam Turner 40855f3ab8
GH-121970: Use Ruff to check and format the docs tools (#122018)
Co-authored-by: Alex Waygood <Alex.Waygood@gmail.com>
2024-07-19 11:48:53 +00:00
Adam Turner 898e90c3be
GH-121970: Make ``DeprecatedRemoved`` a subclass of ``VersionChange`` (#121971) 2024-07-19 11:39:51 +01:00
Adam Turner adf0b94d1c
GH-121970: Improve the glossary preview in HTML search (#121991) 2024-07-19 10:16:59 +01:00
Serhiy Storchaka 1a0c7b9ba4
gh-121905: Consistently use "floating-point" instead of "floating point" (GH-121907) 2024-07-19 08:06:02 +00:00
Adam Turner 420d943128
Docs: Upgrade Sphinx to 7.4 (#121987) 2024-07-19 08:58:19 +01:00
Adam Turner ac39151a09
GH-121970: Use ``SphinxDirective`` instead of ``Directive`` (#121972) 2024-07-19 08:33:51 +01:00
Kirill Podoprigora 98e5bdef0e
Docs: Fix typo in description of ``INTRINSIC_ASYNC_GEN_WRAP`` (#122004) 2024-07-19 08:30:01 +01:00
Serhiy Storchaka c8d2630995
gh-82017: Support as_integer_ratio() in the Fraction constructor (GH-120271)
Any objects that have the as_integer_ratio() method (e.g. numpy.float128)
can now be converted to a fraction.
2024-07-19 08:06:53 +03:00
Adam Turner 7dd52b63ce
GH-117928: Bump the minimum Sphinx version to 6.2.1 (#121986) 2024-07-18 21:05:38 +00:00
Adam Turner 7431c3799e
GH-121970: Combine custom Pygments lexers into a package (#121976)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-07-18 18:38:29 +00:00
Vlastimil Zíma 94e6644584
gh-65453: Docs - clarify AttributeError behaviour on PropertyMock (GH-121666)
Fixed at EuroPython 24 sprints.
2024-07-18 15:57:21 +02:00
Bernhard M. Wiedemann 24cf867bed
gh-121874: Define audit-event open parameters consistently (GH-121883)
Use same names for parameters to avoid triggering a race-condition in Sphinx
that causes non-deterministic output.
2024-07-18 13:05:39 +03:00
Rafael Fontenelle 5d98a4d266
Remove duplicate "it" in whatsnew 3.13 (#121580) 2024-07-17 00:31:21 -07:00
sobolevn 72dccd6073
gh-121834: Improve `complex` C-API docs (#121835)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-07-17 10:01:28 +03:00
Wulian233 37611171af
gh-121453: Update the `Doc/templates/download.html` download files size estimates and support download `.texi` format. (#121454)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-07-17 00:20:55 -06:00
Bernhard M. Wiedemann 941b3b7f44
gh-121871: Allow overriding docs build date with SOURCE_DATE_EPOCH (#121872) 2024-07-16 23:34:00 -06:00
Zachary Ware 4e35dd607b
gh-83648: Use versionadded in 'deprecated' description (GH-121877) 2024-07-16 21:26:17 +00:00
Pablo Galindo Salgado c46d64e0ef
gh-121130: Fix f-string format specifiers with debug expressions (#121150) 2024-07-16 19:57:22 +01:00
Andreas Stocker 8f2532168b
gh-59022: Added tests for `pkgutil.extend_path` (#59022) (GH-121673)
This adds tests for the documented behaviour of `pkgutil.extend_path`
regarding different argument types as well as for `*.pkg` files.
2024-07-16 17:14:26 +02:00
Petr Viktorin b4aedb23ae
gh-113993: Don't immortalize in PyUnicode_InternInPlace; keep immortalizing in other API (#121364)
* Switch PyUnicode_InternInPlace to _PyUnicode_InternMortal, clarify docs

* Document immortality in some functions that take `const char *`

This is PyUnicode_InternFromString;
PyDict_SetItemString, PyObject_SetAttrString;
PyObject_DelAttrString; PyUnicode_InternFromString;
and the PyModule_Add convenience functions.

Always point out a non-immortalizing alternative.

* Don't immortalize user-provided attr names in _ctypes
2024-07-16 15:36:21 +02:00
Alyssa Coghlan d7a099d7ae
GH-105879: Note exec/eval keyword change in What's New (GH-121831) 2024-07-16 13:24:45 +00:00
Ned Deily f27593a87c
gh-120522: Revert "Add a `--with-app-store-compliance` configure option to patch out problematic code" (gh-120984) (#121844)
This reverts commit 48cd104b0c prior
to the release of 3.13.0b4 to allow for additional review time.
2024-07-16 06:49:36 -04:00
edson duarte 1755df7b3b
gh-85453: Fix 'timezone' vs. 'time zone' spelling issues in datetime.rst (#118449) 2024-07-16 10:17:00 +02:00
Russell Keith-Magee 7e91e0dcfe
gh-120831: Increase the default minimum supported iOS version to 13.0 (#121250)
Increases the default minimum iOS version to 13.0.

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2024-07-16 12:23:35 +08:00
Donghee Na 2bac2b86b1
gh-121403: Add notes for PyList_GetXXX APIs about the need for init (gh-121626) 2024-07-16 10:16:41 +09:00
Serhiy Storchaka 94bee45dee
gh-84978: Add float.from_number() and complex.from_number() (GH-26827)
They are alternate constructors which only accept numbers
(including objects with special methods __float__, __complex__
and __index__), but not strings.
2024-07-15 16:07:00 +00:00
Dominic H 8303d32ff5
gh-117765: Improve documentation for `mocker.patch.dict` (#121755) 2024-07-15 07:14:17 +00:00
Jelle Zijlstra 50eec501fe
gh-57141: Make shallow argument to filecmp.dircmp keyword-only (#121767)
It is our general practice to make new optional parameters keyword-only,
even if the existing parameters are all positional-or-keyword. Passing
this parameter as positional would look confusing and could be error-prone
if additional parameters are added in the future.
2024-07-14 15:53:32 -07:00
Dominic H 26dfb27712
gh-121749: Fix discrepancy in docs for `PyModule_AddObjectRef` (GH-121750) 2024-07-14 10:11:10 +00:00
Jan Musílek f6f4022a35
gh-64308: Remove TestProgram from the unittest docs (GH-121675) 2024-07-14 10:57:12 +02:00
Ulrik Södergren b5805892d5
gh-73159 Added clarifications in multiprocessing docs on that objects are pickled. (GH-121686)
Added explicit comments about that objects are pickled when transmitted via multiprocessing queues and pipes.
2024-07-13 13:07:40 -07:00
Bénédikt Tran f4d6e45c1e
gh-120452: improve documentation about private name mangling (#120451)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-07-13 07:45:18 -07:00
mirelagrigoras 422855ad21
gh-120823: Fix doc for ftplib.FTP.retrbinary() (GH-121697)
Co-authored-by: Mirela Andreea GRIGORAS <magrigoras@bitdefender.com>
2024-07-13 16:16:26 +02:00
Timon Viola fc21781175
gh-96765: Update ConfigParser.read() docs with multi-file read example (#121664)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-07-13 12:47:05 +00:00
sobolevn e6264b44dc
gh-121615: Improve `module.rst` C-API docs with better error descriptions (#121616) 2024-07-11 11:57:22 +03:00
Tian Gao 690b9355e0
gh-121450: Make inline breakpoints use the most recent pdb instance (#121451) 2024-07-10 19:54:27 -07:00
sobolevn 84a5597b08
gh-121567: Improve `slice` C-API docs by mentioning exceptions (#121568)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2024-07-10 13:56:44 +03:00
sobolevn 649d5b6d7b
gh-121533: Improve `PyCell_[Get,Set]` docs: mention the exceptions (#121534)
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-07-09 18:47:35 +03:00
Rafael Fontenelle 9ba2a4638d
Docs: fix typo and duplicate word in configure.rst (#121410) 2024-07-09 14:24:37 +02:00
AN Long facf9862da
gh-121333: Clarify what is the default executor for asyncio.run_in_executor (#121335)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-07-09 14:52:07 +05:30
Hugo van Kemenade 006b53a42f
NEWS: Fix Sphinx warnings and increase threshold for new news nits (#121482)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-07-08 14:30:05 -06:00
CBerJun bf74db731b
gh-121461: Fix os.path.normpath documentation indentation (#121466) 2024-07-08 03:51:03 +00:00
Kirill Podoprigora 53e12025cd
Regen ``Doc/requirements-oldest-sphinx.txt`` (#121437)
regen dependencies
2024-07-06 20:04:41 +02:00
Bénédikt Tran ada964fba0
[docs] fix a Sphinx directive in `c-api/object.rst` (#121430) 2024-07-06 19:57:26 +02:00
Barney Gale 88fc0655d4
GH-73991: Support preserving metadata in `pathlib.Path.copy()` (#120806)
Add *preserve_metadata* keyword-only argument to `pathlib.Path.copy()`, defaulting to false. When set to true, we copy timestamps, permissions, extended attributes and flags where available, like `shutil.copystat()`. The argument has no effect on Windows, where metadata is always copied.

Internally (in the pathlib ABCs), path types gain `_readable_metadata` and `_writable_metadata` attributes. These sets of strings describe what kinds of metadata can be retrieved and stored. We take an intersection of `source._readable_metadata` and `target._writable_metadata` to minimise reads/writes. A new `_read_metadata()` method accepts a set of metadata keys and returns a dict with those keys, and a new `_write_metadata()` method accepts a dict of metadata. We *might* make these public in future, but it's hard to justify while the ABCs are still private.
2024-07-06 17:18:39 +01:00
Yuxin Wu 892e3a1b70
Update example of str.split, bytes.split (#121287)
In `{str,bytes}.strip(chars)`, multiple characters are not treated as a
prefix/suffix, but as individual characters. This may make users confuse
whether `split` has similar behavior.
Users may incorrectly expect that
`'Good morning, John.'.split(', .') == ['Good', 'morning', 'John']`

Adding a bit of clarification in the doc.

Co-authored-by: Yuxin Wu <ppwwyyxx@users.noreply.github.com>
2024-07-05 13:08:29 -07:00
Sergey B Kirpichev d4faa7bd32
gh-121149: improve accuracy of builtin sum() for complex inputs (gh-121176) 2024-07-05 10:01:05 -05:00
Ali Tavallaie cb688bab08
gh-90437: Fix __main__.py documentation wording (GH-116309)
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Frank Dana <ferdnyc@gmail.com>
2024-07-04 15:49:14 -07:00
Jongbum Won 715ec630dd
gh-121355: Fix incorrect word in simple_stmts.rst (#121356) 2024-07-04 06:34:34 -07:00
Bénédikt Tran 9728ead361
gh-121141: add support for `copy.replace` to AST nodes (#121162) 2024-07-03 20:10:54 -07:00
Vinay Sajip 26d24eeb90
gh-121035: Update PNG image for logging flow diagram. (GH-121323) 2024-07-03 12:33:28 +01:00
Sergey B Kirpichev 51c4a324c0
gh-61103: Support float and long double complex types in ctypes module (#121248)
This amends 6988ff02a5: memory allocation for
stginfo->ffi_type_pointer.elements in PyCSimpleType_init() should be
more generic (perhaps someday fmt->pffi_type->elements will be not a
two-elements array).

It should finally resolve #61103.

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-07-03 11:08:11 +02:00
Amin Alaee 9d3c9b822c
Docs: Add `os.splice` flags argument (#109847)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Blaise Pabon <blaise@gmail.com>
2024-07-03 13:40:57 +05:30
da-woods 4232976b02
docs: Fix "Py_TPFLAGS_MANAGED_WEAKREF is set in tp_flags" (#112237) 2024-07-03 13:35:02 +05:30
AN Long ff5751a208
gh-111872: Document the max_children attribute for `socketserver.ForkingMixIn` (#118134) 2024-07-03 13:16:57 +05:30