Commit Graph

28834 Commits

Author SHA1 Message Date
Gregory P. Smith
1fe67df8e3
gh-48020: [docs] Remove the logging howto suggested future FileHandler multiprocessing support (GH-126531)
Docs: Remove the logging howto potential promise of multiprocessing support in the future.

Stick to the facts and suggestions, don't provide hope where we're not going to
implement complexity that we'd rather the user implement themselves when
needed.
2024-11-07 01:57:01 -08:00
Kamil Turek
9cba47d9f1
gh-122838: Document missing opcodes (#123073) 2024-11-06 12:16:13 +00:00
Cody Maloney
6431f379b8
gh-120754: Add to io optimization to what's new (#126466) 2024-11-06 07:54:40 +01:00
Barney Gale
ff8349979c
GH-124985: Document that pathlib.Path.copy() uses copy-on-write. (#125861) 2024-11-05 18:43:43 +00:00
Richard Hansen
407c0366d9
Doc: C API: Delete claim that PyObject_Init is GC-aware (#126418) 2024-11-05 15:18:46 +05:30
Lukas Geiger
3d4fda2165
gh-119793: Prefer map(..., strict=True) over starmap/zip in examples (#126407) 2024-11-05 08:53:32 +01:00
Victor Stinner
4a0d574273
gh-120057: Add os.reload_environ() function (#126268)
Replace the os.environ.refresh() method with a new
os.reload_environ() function.

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>
2024-11-05 08:43:34 +01:00
lit
d960226547
gh-125436: Doc: Add missing `allow_unnamed_section parameter to ConfigParser` documentation (#125437)
Add missing ``allow_unnamed_section`` parameter to ``ConfigParser`` doc, as well as to it's parent ``RawConfigParser``.
Split too long line on ``ConfigParser`` signature.
Add some sections about when some of ``RawConfigParser`` parameters were added.
2024-11-05 02:58:15 +00:00
Mikhail Efimov
e5a4b402ae
Doc: Fix typo in documentation for `MAKE_FUNCTION` opcode (#126396) 2024-11-04 19:28:05 +02:00
Hugo van Kemenade
eac41c5ddf
gh-101865: Docs: Keep co_lnotab deprecation for at least 3.14 (#126392) 2024-11-04 18:49:59 +02:00
Nice Zombies
3032fcd90e
gh-119793: Add optional length-checking to map() (GH-120471)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2024-11-04 15:00:19 +01:00
Kumar Aditya
fe5a6ab7be
gh-126353: remove implicit creation of loop from asyncio.get_event_loop (#126354)
Remove implicit creation of loop from `asyncio.get_event_loop`. This is a step forward of deprecating the policy system of asyncio.
2024-11-04 14:21:20 +05:30
Erlend E. Aasland
0d80777981
Docs: turn getopt examples into doctests (#126377) 2024-11-04 09:27:25 +01:00
Zhikang Yan
081706f873
gh-126165: Improve docs of function math.isclose (#126215)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-11-03 23:08:15 -05:00
Hugo van Kemenade
9441993f27
Docs: Delist sqlite3 deprecation from "Pending removal in 3.14" (#126370) 2024-11-03 21:22:49 +00:00
Sergey B Kirpichev
7d7d56d8b1
gh-99880: document rounding mode for new-style formatting (GH-121481)
* gh-99880: document rounding mode for new-style formatting

The CPython uses _Py_dg_dtoa(), which does rounding to nearest with half
to even tie-breaking rule.

If that functions is unavailable, PyOS_double_to_string() fallbacks to
system snprintf().  Since CPython 3.12, build requirements include C11
compiler *and* support for IEEE 754 floating point numbers (Annex F).
This means that FE_TONEAREST macro is available and, per default,
printf-like functions should use same rounding mode as _Py_dg_dtoa().

* Update Doc/library/string.rst

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-11-02 10:11:12 -07:00
고병찬
10eeec2d4f
gh-125761: Clarify repeated warning suppression criteria in warnings module (gh-126326) 2024-11-02 21:37:26 +10:00
rimchoi
914356f4d4
gh-125875: Fix docs typo FORMAT_SPEC to FORMAT_WITH_SPEC (gh-126319)
Fix docs typo FORMAT_SPEC to FORMAT_WITH_SPEC
2024-11-02 14:08:27 +09:00
Sergey B Kirpichev
8477951a1c
gh-120026: soft deprecate Py_HUGE_VAL macro (#120027)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-11-01 22:04:31 +00:00
Joseph Martinot-Lagarde
74cf5967f3
Doc: Add a single table as summary to math documentation (GH-125810)
* Summary for math module with separate tables

* Forgot remainder description

* Single table

* data instead of func

* Add arguments in the table

* Fix inconsistencies in pow documentation

* Remove full stops from the table

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>

* Fix math.pow link

* Fix spacing

---------

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-11-01 12:35:05 -07:00
Filip "Ret2Me" Poplewski
ff257c7843
docs: add a more precise example in enum doc (GH-121015)
* docs: add a more precise example

Previous example used manual integer value assignment in class based declaration but in functional syntax has been used auto value assignment what could be confusing for the new users. Additionally documentation doesn't show how to declare new enum via functional syntax with usage of the manual value assignment.

* docs: remove whitespace characters

* refactor: change example

---------

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2024-11-01 12:28:50 -07:00
Bénédikt Tran
464a7a91d0
gh-97850: remove `find_loader and get_loader from pkgutil` (#119656)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Brett Cannon <brett@python.org>
2024-11-01 18:35:22 +02:00
sobolevn
295262c8ec
gh-126259: Fix "unclosed database" warning in sqlite3 doctest (#126260) 2024-11-01 08:17:05 +01:00
Barney Gale
260843df1b
GH-125413: Add pathlib.Path.scandir() method (#126060)
Add `pathlib.Path.scandir()` as a trivial wrapper of `os.scandir()`. This
will be used to implement several `PathBase` methods more efficiently,
including methods that provide `Path.copy()`.
2024-11-01 01:19:01 +00:00
Alperen Keleş
d0abd0b826
gh-126256: Update time.rst to use the same clock as instead of the same clock than (#126257)
Update time.rst to use `the same clock as` instead of `the same clock than`

The time documentation uses the same clock than time.monotonic instead of the same clock as time.monotonic, which is grammatically false. This PR fixes changes two instances of `the same clock than` to `the same clock as`.
2024-10-31 21:44:34 +00:00
RUANG (James Roy)
d467d9246c
gh-125818: Fix incorrect signature of argument skip_file_prefixes in warnings docs (GH-125823)
Change documentation
2024-10-30 18:15:07 -07:00
Richard Hansen
616468b87b
gh-125674: Doc: Fix type of newfunc first parameter (GH-125675)
* gh-125674: Doc: Fix type of `newfunc` first parameter

* fixup! gh-125674: Doc: Fix type of `newfunc` first parameter

---------

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-10-30 13:27:37 -07:00
AN Long
5768fef355
gh-114990: Add missing mixin methods in collections.abc's document (GH-114991)
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-10-30 13:17:20 -07:00
Victor Wheeler
597d814334
gh-126055: Add omitted command (in docs [os.walk]) for code to fulfill shutil.rmtree algorithm (GH-126067)
* gh-126055:  Add omitted command (in docs [os.walk]) for code to fulfill `shutil.rmtree` algorithm.

Resolves #126055

* gh-126055:  Fix omitted code highlighting
2024-10-30 11:22:58 -07:00
Furkan Onder
4f826214b3
gh-60712: Include the "object" type in the lists of documented types (GH-103036)
* add test for the predefined object's attributes

* Include the "object" type in the lists of documented types

* remove 'or' from augment tuple

* 📜🤖 Added by blurb_it.

* Add cross-reference to news

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>

* Fix format for the function parameter

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>

* Add space

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>

* add reference for the 'object'

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>

* add reference for NotImplemented

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>

* Change ref:`string <textseq>`  as class:`str`

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>

* remove hyphen from `newly-created`

* Update Doc/reference/datamodel.rst

'dictionaries' to 'dict'

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>

* Update predefined attribute types in testPredefinedAttrs

* Change `universal type` as `top type`

* Don't mention about the top type

* Update the description of richcmpfuncs

* Update Doc/library/stdtypes.rst

Co-authored-by: Éric <merwok@netwok.org>

* Revert: Hierarchy Section in Data Model Documentation

* Revert to original explanations of __new__ and __init__ methods in datamodel.rst for improved clarity.

* Update Doc/reference/datamodel.rst

Co-authored-by: Éric <merwok@netwok.org>

* Remove blank line

Co-authored-by: Éric <merwok@netwok.org>

* Use ref:`str <textseq>` instead of :class:`str

Co-authored-by: Éric <merwok@netwok.org>

* Revert changes the description of Other Built-in Types in stdtypes.rst

* Update Doc/reference/datamodel.rst

Co-authored-by: Éric <merwok@netwok.org>

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-10-30 11:20:02 -07:00
Rafael Fontenelle
6f512c6034
Fix incorrect indentation in importlib.metadata.rst (GH-126189) 2024-10-30 10:46:09 -07:00
amaajemyfren
a3443c0e22
gh-85583: Add f-string index in tutorial/inputoutput.rst (GH-21681)
* bpo-41411 fstring index in tutorial/inputoutput

To assist in searching for fstrings I have added an index

* Add newline

---------

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-10-30 10:26:29 -07:00
sobolevn
1f16df4bfe
gh-125669: Do not run -ugui tests by default on make test (#125730)
Adds `make ci` target for use in CI and keeping `make test` for the local development.
2024-10-30 17:14:22 +03:00
Xuanteng Huang
35df4eb959
gh-126072: do not add None to co_consts if there is no docstring (GH-126101) 2024-10-30 09:01:09 +00:00
Serhiy Storchaka
2ab377a47c
gh-126071: Improve formatting of the argparse documentation (GH-126073)
* Use appropriate roles for ArgumentParser, Action, etc.
* Remove superfluous repeated links.
* Explicitly document signatures and add index entries for some methods
  and classes.
* Make it more clear that some parameters are keyword-only.
* Fix some minor errors.
2024-10-30 08:50:12 +00:00
Daniel Ruf
00e5ec0d35
gh-118633: Add warning regarding the unsafe usage of eval and exec (GH-118437)
* Add warning regarding the unsafe usage of eval

* Add warning regarding the unsafe usage of exec

* Move warning under parameters table

* Use suggested shorter text

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>

* Use suggested shorter text

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>

* Improve wording as suggested

---------

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-10-30 00:36:18 +00:00
Hugo van Kemenade
d4b6d84cc8
gh-58032: Docs: Sort argparse alphabetically (GH-125871)
Sort argparse alphabetically
2024-10-29 17:13:11 -07:00
Pablo Galindo Salgado
2d37c719ed
gh-124855: Don't allow the JIT and perf support to be active at the same time (#124856) 2024-10-30 00:12:45 +00:00
Ned Batchelder
2d9d10179f
docs: restore an anchor to for/else (#126154) 2024-10-29 20:11:50 -04:00
Matthieu Ancellin
0e45b1fd0f
Doc: Note that pydoc uses and prefers `MANPAGER` (#125362)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-10-29 23:12:02 +00:00
Wim Jeantine-Glenn
298e041631
bpo-41793: Fix an inaccuracy about reflected methods in datamodel docs (GH-22257)
* Qualifying that the right operand's type must be a *strict* subclass for the reflected method to take precedence avoids an edge case / counter-example when the types are actually equal.

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2024-10-29 16:02:27 -07:00
Prometheus3375
5527c4051c
gh-116938: Fix dict.update docstring and remove erraneous full stop from dict documentation (#125421)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-10-29 23:00:04 +00:00
Carol Willing
9effa0ff06
Add lightweight comments to conf.py and update docs readme (GH-126100)
* Update contributing contact info in readme

* Add lightweight comments to improve docs workflow understanding

* Apply code review suggestions from @hugovk

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>

* Add code review suggestion from @AA-Turner

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>

* Update Doc/conf.py

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>

* Update Doc/conf.py

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>

* Update Doc/conf.py

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: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-10-29 17:45:03 +00:00
Sergey B Kirpichev
0bbbe15f56
gh-122767: document "new style" formatting for complexes (GH-122848)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-10-29 14:36:18 +00:00
Mark Shannon
faa3272fb8
GH-125837: Split LOAD_CONST into three. (GH-125972)
* Add LOAD_CONST_IMMORTAL opcode

* Add LOAD_SMALL_INT opcode

* Remove RETURN_CONST opcode
2024-10-29 11:15:42 +00:00
RUANG (James Roy)
85799f1ffd
gh-89762: Document strftime %G, %V, and %u format specifiers (#124572) 2024-10-28 21:53:18 +00:00
Brian Schubert
dc76a4ad3c
gh-126012: Add __class_getitem__ to memoryview (#126013)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2024-10-27 13:36:03 +03:00
Zhikang Yan
dad3453129
gh-125633: Add function ispackage to stdlib inspect (#125634)
---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2024-10-27 14:57:43 +10:00
Bogdana Vereha
a78d5b3242
Fix a typo in `Doc/tutorial/errors.rst` exception output (#126001) 2024-10-26 18:26:35 +03:00
Bénédikt Tran
417c130ba5
gh-120313: amend documentation regarding ctypes._CFuncPtr (GH-120989)
improve docs
2024-10-25 15:32:23 +02:00
Victor Stinner
db96327203
gh-121654: Add PyType_Freeze() function (#122457)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-10-25 11:12:48 +02:00
Serhiy Storchaka
da8673da36
gh-84545: Clarify the 'extend' action documentation in argparse (GH-125870) 2024-10-25 08:41:38 +00:00
Kerim Kabirov
1306f33c84
gh-125933: Add ARIA labels to select elements in the version switcher (#125934)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-10-24 23:52:21 +03:00
Shantanu
500f5338a8
gh-123930: Better error for "from imports" when script shadows module (#123929) 2024-10-24 12:11:12 -07:00
partev
5003ad5c5e
gh-125909: Avoid a redirect when linking to the devguide (#125826) 2024-10-24 17:41:01 +01:00
Wulian
9c01db40aa
gh-125665: Update turtledemo docstrings with correct file names (#125691)
Co-authored-by: Wulian <xiguawulian@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-10-23 16:29:32 -04:00
Eric Snow
6f26d496d3
gh-125286: Share the Main Refchain With Legacy Interpreters (gh-125709)
They used to be shared, before 3.12.  Returning to sharing them resolves a failure on Py_TRACE_REFS builds.

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-10-23 10:10:06 -06:00
Serhiy Storchaka
834ba5aaf2
gh-58032: Deprecate the argparse.FileType type converter (GH-124664) 2024-10-23 10:50:29 +03:00
Jacob Walls
c75ff2ef8e
gh-80958: unittest: discovery support for namespace packages as start directory (#123820) 2024-10-23 13:41:33 +09:00
Adam Turner
91ddde4af0
Doc: Show object descriptions in the table of contents (#125757) 2024-10-22 14:07:09 +01:00
Serhiy Storchaka
dcc4fb2c90
gh-124969: Make locale.nl_langinfo(locale.ALT_DIGITS) returning a string again (GH-125774)
This is a follow up of GH-124974. Only Glibc needed a fix.
Now the returned value is a string consisting of semicolon-separated
symbols on all Posix platforms.
2024-10-21 18:54:12 +00:00
Serhiy Storchaka
5ca4e34bc1
gh-125767: Fix pickling and copying of super objects (GH-125781)
Previously, copying a super object returned a copy of the instance
invoking super(). Pickling a super object could pickle the instance
invoking super() or fail, depending on its type and protocol.

Now deep copying returns a new super object and pickling pickles the super
object. Shallow copying returns the same super object.
2024-10-21 21:30:45 +03:00
Richard Hansen
d880c83ff7
Doc: C API: Move tp_dealloc paragraph to tp_dealloc section (#125737)
It looks like commit 43cf44ddcc
(gh-31501) accidentally moved the paragraph to the `tp_finalize`
section when the intent was to move it to the `tp_dealloc` section
(according to the commit message).

Also:
  * Convert the paragraph to a warning.
  * Apply the appropriate font style to `tp_dealloc`.
  * Unlinkify the first mention of `tp_dealloc` since the paragraph is
    already in the `tp_dealloc` section.
2024-10-21 09:46:37 -07:00
partev
d67bf2d89a
gh-125766: Docs: minor rewording of installation on Linux section (GH-125743) 2024-10-21 16:18:10 +00:00
Y5
7d88140d52
gh-125313: Prefer sys.base_* paths in Py_Get(Exec)Prefix deprecation notes (#125317)
Prefer `sys.base_*` paths in `Py_Get(Exec)Prefix` deprecation notes.

Signed-off-by: y5c4l3 <y5c4l3@proton.me>
2024-10-21 11:35:54 +02:00
ember91
ded105a62b
Doc: Fix typos (#125728) 2024-10-21 10:44:18 +02:00
RUANG (Roy James)
9256be7ff0
gh-99030: Added documentation links for types and exceptions (GH-123857)
* Added documentation links for types and exceptions

* Shortened description sentences

* Change content

* Change documentation

* Move seealso

* Add a spaces
2024-10-20 17:36:27 -07:00
Tom Most
14cafe1a10
Doc: Fix pluralization in os.process_cpu_count() documentation (#125678) 2024-10-20 01:48:06 +01:00
Savannah Ostrowski
84074a4fd8
GH-99749: Add What's New entry for GH-124456 (GH-125671) 2024-10-19 11:26:46 +03:00
Adam Turner
2bb7ab7ad3
GH-125277: Increase minimum supported Sphinx to 7.2.6 (#125368) 2024-10-19 04:59:22 +01:00
Sam Gross
d8c8648161
gh-125541: Make Ctrl-C interrupt threading.Lock.acquire() on Windows (#125546) 2024-10-17 20:10:55 +02:00
chrysn
b454662921
gh-118986: expose socket.IPV6_RECVERR (#118987) 2024-10-17 20:49:12 +03:00
Savannah Ostrowski
dbcc5ac470
gh-95836: Add custom type converter examples to argparse tutorial (GH-125376) 2024-10-17 14:41:22 +03:00
Savannah Ostrowski
7b04496e5c
gh-125542: Deprecate prefix_chars in ArgumentParser.add_argument_group() (GH-125563) 2024-10-17 09:11:47 +00:00
Savannah Ostrowski
624be8699a
GH-99749: Add optional feature to suggest correct names (ArgumentParser) (GH-124456) 2024-10-17 10:07:37 +03:00
Eric Snow
a5a7f5e16d
gh-124694: Add concurrent.futures.InterpreterPoolExecutor (gh-124548)
This is an implementation of InterpreterPoolExecutor that builds on ThreadPoolExecutor.

(Note that this is not tied to PEP 734, which is strictly about adding a new stdlib module.)

Possible future improvements:

* support passing a script for the initializer or to submit()
* support passing (most) arbitrary functions without pickling
* support passing closures
* optionally exec functions against __main__ instead of the their original module
2024-10-16 16:50:46 -06:00
Cornelius Roemer
aab3210271
gh-125615: Fix grammar nit in tutorial's interactive interpreter appendix (GH-125617)
Replace "without ... nor" with "with neither ... nor"
2024-10-16 15:53:30 -05:00
Kirill Podoprigora
bee112a94d
gh-124872: Replace enter/exit events with "switched" (#125532)
Users want to know when the current context switches to a different
context object.  Right now this happens when and only when a context
is entered or exited, so the enter and exit events are synonymous with
"switched".  However, if the changes proposed for gh-99633 are
implemented, the current context will also switch for reasons other
than context enter or exit.  Since users actually care about context
switches and not enter or exit, replace the enter and exit events with
a single switched event.

The former exit event was emitted just before exiting the context.
The new switched event is emitted after the context is exited to match
the semantics users expect of an event with a past-tense name.  If
users need the ability to clean up before the switch takes effect,
another event type can be added in the future.  It is not added here
because YAGNI.

I skipped 0 in the enum as a matter of practice.  Skipping 0 makes it
easier to troubleshoot when code forgets to set zeroed memory, and it
aligns with best practices for other tools (e.g.,
https://protobuf.dev/programming-guides/dos-donts/#unspecified-enum).

Co-authored-by: Richard Hansen <rhansen@rhansen.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-10-16 13:53:21 +02:00
Hugo van Kemenade
8cdaca8b25 Python 3.14.0a1 2024-10-15 22:34:54 +03:00
Savannah Ostrowski
c9826c11db
gh-89819: Add argument_default and conflict_handler to add_argument_group() docs (GH-125379) 2024-10-15 15:48:28 +00:00
Kirill Podoprigora
d3c82b9cce
gh-125512: Revert "gh-124872: Replace enter/exit events with "switched" (#124776)" (#125513) 2024-10-15 17:42:16 +03:00
sobolevn
c8a1818fb0
gh-125517: Fix unreachable code warnings in _testembed.c (#125518) 2024-10-15 13:12:32 +00:00
RUANG (Roy James)
546dddca43
gh-125234: Make PyInitConfig_Free(NULL) a no-op (#125266) 2024-10-15 09:21:16 +00:00
Hugo van Kemenade
66064c342c
gh-123299: Copyedit "What's New in Python 3.14" (#125438) 2024-10-15 10:39:15 +03:00
Mariusz Felisiak
a2fe9ff11d
Doc: Update CVE URL (#125489) 2024-10-15 10:29:08 +03:00
edson duarte
2a5cdb2516
gh-85453: Improve variable mark up for datetime.rst (#120702)
Variables and literals are marked up using backticks.
2024-10-15 00:02:58 +02:00
Richard Hansen
843d28f59d
gh-124872: Replace enter/exit events with "switched" (#124776)
Users want to know when the current context switches to a different
context object.  Right now this happens when and only when a context
is entered or exited, so the enter and exit events are synonymous with
"switched".  However, if the changes proposed for gh-99633 are
implemented, the current context will also switch for reasons other
than context enter or exit.  Since users actually care about context
switches and not enter or exit, replace the enter and exit events with
a single switched event.

The former exit event was emitted just before exiting the context.
The new switched event is emitted after the context is exited to match
the semantics users expect of an event with a past-tense name.  If
users need the ability to clean up before the switch takes effect,
another event type can be added in the future.  It is not added here
because YAGNI.

I skipped 0 in the enum as a matter of practice.  Skipping 0 makes it
easier to troubleshoot when code forgets to set zeroed memory, and it
aligns with best practices for other tools (e.g.,
https://protobuf.dev/programming-guides/dos-donts/#unspecified-enum).
2024-10-14 12:28:41 -07:00
Paul Hoffman
5dac0dceda
gh-125461: Remove Python 2 from identifiers in doc (GH-125462)
Remove Python 2 from identifiers in doc
2024-10-14 15:26:57 +00:00
Mikhail Efimov
45df264f3f
gh-112088: aclocal version is updated to 1.16.5 in docs (#125457) 2024-10-14 16:53:08 +02:00
Serhiy Storchaka
5217328f93
gh-121798: Add class method Decimal.from_number() (GH-121801)
It is an alternate constructor which only accepts a single numeric argument.
Unlike to Decimal.from_float() it accepts also Decimal.
Unlike to the standard constructor, it does not accept strings and tuples.
2024-10-14 08:24:01 +00:00
Serhiy Storchaka
b52c7306ea
gh-121797: Add class method Fraction.from_number() (GH-121800)
It is an alternative constructor which only accepts a single numeric argument.
Unlike to Fraction.from_float() and Fraction.from_decimal() it accepts any
real numbers supported by the standard constructor (int, float, Decimal,
Rational numbers, objects with as_integer_ratio()).
Unlike to the standard constructor, it does not accept strings.
2024-10-14 07:54:59 +00:00
Sergey B Kirpichev
cfc27bc50f
gh-123133: clarify p=0 case for "f" and "e" formatting types (GH-125426)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-10-13 21:44:48 -07:00
Sergey B Kirpichev
c6d7b644c2
gh-101291: Add versionadded directives for PyUnstable_Long_* (#125384) 2024-10-13 19:38:42 +02:00
partev
6c386b703d
gh-125403: fix console formatting in Chapter 12 of the tutorial (#125404) 2024-10-13 22:16:15 +05:30
Wulian
283ea5f3b2
gh-125383: Update fib function comment for accuracy (#125386)
`Doc/tutorial/controlflow.rst`: fix comment for `fib` function
2024-10-13 14:10:59 +03:00
Ruoyu Zhong
a8fa4ad9e9
Doc: Fix suggested usage of -X gil=0 in the glossary (#125366)
Currently, the "global interpreter lock" entry in the glossary mentions
that `-X gil 0` can be used to disable the GIL [1]. However, this is
invalid; the correct usage should be `-X gil=0`.

    $ python -X gil 0 -c 'print("Hello, world")'
    Fatal Python error: config_read_gil: PYTHON_GIL / -X gil must be "0" or "1"
    Python runtime state: preinitialized

    $ python -X gil=0 -c 'print("Hello, world")'
    Hello, world

[1]: https://docs.python.org/3/using/cmdline.html#cmdoption-X

Signed-off-by: Ruoyu Zhong <zhongruoyu@outlook.com>
2024-10-13 01:53:28 +01:00
Richard Hansen
330c527299
gh-124872: Change PyContext_WatchCallback to take PyObject (#124737)
The PyContext struct is not intended to be public, and users of the
API don't need anything more specific than PyObject.  Also see
gh-78943.
2024-10-12 13:57:27 -07:00
Ghorban M. Tavakoly
fa52b82c91
gh-125289: Update sample code in asyncio-task.rst (GH-125292)
* Update sample code in asyncio-task.rst

This will change **coroutines** sample code in the **Awaitables** section and make the example clearer.

* Update Doc/library/asyncio-task.rst

Revert the added print

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>

* Update Doc/library/asyncio-task.rst

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>

---------

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-10-12 13:38:13 -07:00
Stephen Rosen
4a2282b067
Prefer "similar" over "equivalent" in tutorial (#125343)
In the datastructures tutorial doc, some operations are described as
"equivalent to" others. This has led to some user-confusion -- at
least in the Discourse forums -- about cases in which the operations
differ.

This change doesn't systematically eliminate the word "equivalent"
from the tutorial. It just substitutes "similar to" in several cases
in which "equivalent to" could mislead users into expecting exact
equivalence.
2024-10-12 16:21:55 -04:00
Bernhard M. Wiedemann
dcd58c5084
gh-125260: Change the default `gzip.compress()` mtime to 0 (#125261)
This follows GNU gzip, which defaults to using 0 as the mtime
for compressing stdin, where no file mtime is involved.

This makes the output of gzip.compress() deterministic by default,
greatly helping reproducible builds.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-10-12 18:18:48 +01:00