Commit Graph

26670 Commits

Author SHA1 Message Date
Pablo Galindo Salgado 1ef61cf71a
gh-102856: Initial implementation of PEP 701 (#102855)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
Co-authored-by: Marta Gómez Macías <mgmacias@google.com>
Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
2023-04-19 11:18:16 -05:00
Kumar Aditya da2273fec7
GH-88342: clarify that `asyncio.as_completed` accepts generators yielding tasks (#103626) 2023-04-19 15:51:53 +05:30
Nikita Sobolev f4d087964e
gh-103582: Remove last references to `argparse.REMAINDER` from docs (#103586) 2023-04-18 23:02:48 -06:00
Ethan Furman 700ec657c8
gh-103596: [Enum] do not shadow mixed-in methods/attributes (GH-103600)
For example:

    class Book(StrEnum):
        title = auto()
        author = auto()
        desc = auto()

    Book.author.desc is Book.desc

but

    Book.author.title() == 'Author'

is commonly expected.  Using upper-case member names avoids this confusion and possible performance impacts.

Co-authored-by: samypr100 <3933065+samypr100@users.noreply.github.com>
2023-04-18 16:19:23 -07:00
zyckk4 4e04393b2f
[Doc] Fix a typo in optparse.rst (#103504) 2023-04-18 16:51:26 +05:30
yuki c3d015ce62
gh-101100: Fix broken reference `__format__` in `string.rst` (#103531) 2023-04-18 16:48:53 +05:30
Pradyun Gedam ece20dba12
gh-95299: Stop installing setuptools as a part of ensurepip and venv (#101039)
Remove the bundled setuptools wheel from ensurepip, and stop installing setuptools in environments created by venv.

Co-Authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2023-04-17 23:43:34 -05:00
Rafael Fontenelle f39e00f952
GH-103484: Docs: add linkcheck allowed redirects entries for most cases (#103569)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-04-18 05:57:53 +03:00
Skip Montanaro e35e0f15eb
gh-67230: update whatsnew note for csv changes (#103598) 2023-04-17 21:21:19 -04:00
Giampaolo Rodola ff3303e49c
gh-48330: address review comments to PR-12271 (#103209)
address review comments to PR-12271

Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
2023-04-17 00:19:44 +02:00
AN Long 282f0d26e3
Fix syntax typo in isolating extensions doc (#103516) 2023-04-14 00:40:25 -07:00
Boris Verkhovskiy a3d313a9e2
Proofread howto/perf_profiling.rst (#103530) 2023-04-13 20:07:49 -07:00
Ethan Furman a6f95941a3
gh-103479: [Enum] require __new__ to be considered a data type (GH-103495)
a mixin must either have a __new__ method, or be a dataclass, to be interpreted as a data-type
2023-04-13 08:31:03 -07:00
Ethan Furman 2194071540
gh-103365: [Enum] STRICT boundary corrections (GH-103494)
STRICT boundary:

- fix bitwise operations
- make default for Flag
2023-04-13 08:24:33 -07:00
Skip Montanaro fb38c1b52e
gh-67230: document new csv quoting modes in whatsnew (gh-103491) 2023-04-12 20:45:52 -04:00
Skip Montanaro 330a942b63
gh-67230: add quoting rules to csv module (GH-29469)
Add two quoting styles for csv dialects.
They will help to work with certain databases in particular.

Automerge-Triggered-By: GH:merwok
2023-04-12 15:32:30 -07:00
Nick Burns f2b7ecb778
gh-103417: use time.monotonic in the example for sched.scheduler (#103418) 2023-04-12 01:59:21 -07:00
Furkan Onder d65ed693a8
GH-83893: Cross reference env. vars and -X command line options (GH-103414)
Co-authored-by: Erlend E. Aasland
2023-04-12 01:44:35 -07:00
Bar Harel 8f54302ab4
gh-103357: Add logging.Formatter defaults support to logging.config fileConfig and dictConfig (GH-103359) 2023-04-12 08:35:56 +01:00
Tian Gao 449bf2a76b
gh-103237: Polish pdb docs (#103238) 2023-04-11 23:18:34 -07:00
Tian Gao 2f41a009b7
gh-103143: Polish pdb help messages and doc strings (GH-103144)
* Made all the command part of the docstring match the official documentation
* Always have a space between the command and the description in docstring
* Added a helper function to format the help message

Before:

```
(Pdb) h a
a(rgs)
        Print the argument list of the current function.
(Pdb) h commands
commands [bpnumber]
        (com) ...
        (com) end
        (Pdb)
        ...
(Pdb) h interact
interact

        Start an interactive interpreter whose global namespace
        contains all the (global and local) names found in the current scope.
```

After
```
(Pdb) h a
      Usage: a(rgs)
      
      Print the argument list of the current function.
(Pdb) h commands
      Usage: (Pdb) commands [bpnumber]
             (com) ...
             (com) end
             (Pdb)
             ...
(Pdb) h interact
      Usage: interact
      
      Start an interactive interpreter whose global namespace
      contains all the (global and local) names found in the current scope.
```

Automerge-Triggered-By: GH:brandtbucher
2023-04-11 15:40:30 -07:00
Nikita Sobolev 50b4b15984
gh-87864: Use correct function definition syntax in the docs (#103312) 2023-04-11 16:50:25 +03:00
Irit Katriel 55c99d97e1
gh-77757: replace exception wrapping by PEP-678 notes in typeobject's __set_name__ (#103402) 2023-04-11 11:53:06 +01:00
Alex Waygood e071f00aae
gh-103373: `__mro_entries__` docs: improve cross references (#103398)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2023-04-11 11:25:45 +01:00
Irit Katriel 78b763f630
gh-103176: sys._current_exceptions() returns mapping to exception instances instead of exc_info tuples (#103177) 2023-04-11 09:38:37 +01:00
Hugo van Kemenade 280bd536b5
Docs: don't render files in includes/, they're for embedding only (#103313) 2023-04-11 09:17:34 +03:00
C.A.M. Gerlach 75b6ab80da
Doc: Avoid error lexing multiprocessing docs code block on Pygments 2.15.0 (#103421) 2023-04-10 20:57:36 -07:00
raylu 8b1b17134e
gh-103059: Clarify gc.freeze documentation (#103058) 2023-04-10 10:30:32 -06:00
James Hilton-Balfe ecad802e3f
Fix old behaviour in typing documentation (#103400) 2023-04-09 22:55:32 +01:00
Raymond Hettinger f65fdbb8fd
Itertool recipe improvements (GH-103399) 2023-04-09 14:17:37 -05:00
mara004 975d220bbe
ctypes docs: fix missing `not` in variadic functions section (#102611) 2023-04-09 13:56:52 +05:30
yuki 83af8f2686
Docs: Fix broken reference `__getitem__` in `string.rst` (#103371) 2023-04-09 07:32:16 +05:30
Kumar Aditya 63dc969ec6
Document `asyncio` performance improvement in What's New (#103370)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-04-09 07:29:08 +05:30
Alex Waygood 0ba0ca05d2
gh-103373: Improve documentation for `__mro_entries__` (#103374) 2023-04-08 15:09:00 +01:00
Ezio Melotti 3310b94d3d
gh-100574: add examples/links to the `strptime`/`strftime` docs (#100575) 2023-04-08 11:46:47 +03:00
Adam Turner 1e9dfdacef
Docs: use Node.findall to avoid a deprecation warning (#99403) 2023-04-08 10:56:20 +03:00
Alex Waygood 644136563d
gh-74690: Document changes made to runtime-checkable protocols in 3.12 (#103348)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-04-07 22:06:37 +01:00
Alex Waygood 04501ee57e
gh-103193: Celebrate performance improvements to `inspect.getattr_static` in 'What's New in Python 3.12' (#103349) 2023-04-07 18:14:50 +01:00
Oleg Iarygin f0424ba4b6
gh-103266: Fix a typo in example code for bisect() function (#103267) 2023-04-06 17:34:19 -07:00
Jeffrey Newman 23cf1e20a6
gh-99202: Fix extension type from documentation for compiling in C++20 mode (#102518) 2023-04-06 17:59:36 +02:00
Ethan Furman 4ec8dd10bd
gh-93910: [Enum] remove member.member deprecation (GH-103236)
i.e. Color.RED.BLUE is now officially supported.
2023-04-05 17:33:52 -07:00
Brandt Bucher b4978ff872
GH-88691: Shrink the CALL caches (GH-103230) 2023-04-05 14:15:49 -07:00
Olivier Gayot fdd0fff277
gh-102899: Fix doc link for getting filesystem error handler (#102901) 2023-04-05 16:54:43 +02:00
Serhiy Storchaka a28d4edb23
gh-100408: Fix a traceback in multiprocessing example (#100409) 2023-04-05 12:43:26 +01:00
C.A.M. Gerlach c396b6ddf3
gh-81762: Clarify and simplify description of print's flush param (#103264) 2023-04-05 12:16:36 +01:00
Michael Handler 1a8f862e32
gh-66897: Upgrade HTTP CONNECT to protocol HTTP/1.1 (#8305)
* bpo-22708: Upgrade HTTP CONNECT to protocol HTTP/1.1 (GH-NNNN)

Use protocol HTTP/1.1 when sending HTTP CONNECT tunnelling requests;
generate Host: headers if one is not already provided (required by
HTTP/1.1), convert IDN domains to punycode in HTTP CONNECT requests.

* Refactor tests to pass under -bb (fix ByteWarnings); missed some lines >80.

* Use consistent 'tunnelling' spelling in Lib/http/client.py

* Lib/test/test_httplib: Remove remnant of obsoleted test.

* Use dict.copy() not copy.copy()

* fix version changed

* Update Lib/http/client.py

Co-authored-by: bgehman <bgehman@users.noreply.github.com>

* Switch to for/else: syntax, as suggested

* Don't use for: else:

* Sure, fine, w/e

* Oops

* 1nm to the left

---------

Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: bgehman <bgehman@users.noreply.github.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2023-04-04 21:55:24 -07:00
Dong-hee Na a62ff97075
gh-101525: Disable peephole optimization process of BOLT (gh-103187)
Co-authored-by: Dong-hee Na <donghee.na@linecorp.com>
2023-04-05 09:10:45 +09:00
Tim Burke bceb9e00ad
Improve some grammar in the socket docs (#103254) 2023-04-04 23:46:46 +01:00
Charles Machalow 935aa45235
GH-75586: Make shutil.which() on Windows more consistent with the OS (GH-103179) 2023-04-04 23:24:13 +01:00
Ethan Furman 810d365b5e
gh-103056: [Enum] use staticmethod decorator for _gnv_ (GH-103231)
_gnv_ --> _generate_next_value_
2023-04-03 17:47:40 -07:00
Ethan Furman 5ffc1e5a21
gh-98298, gh-74730: [Enum] update docs (GH-103163)
fix FlagBoundary statements
add warning about reloading modules and enum identity
2023-04-03 14:57:42 -07:00
Hugo van Kemenade 24facd60f6
gh-101100: Use list of 'dirty' docs, with warnings, instead of a clean list (#103191)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-04-03 21:59:47 +03:00
Nikita Sobolev 2a721258a1
gh-101865: Deprecate `co_lnotab` from code objects as per PEP 626 (#101866)
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2023-04-03 17:35:04 +02:00
Nouran Ali 55decb72c4
gh-102994: Profile docs has typo in example (#103074) 2023-04-02 15:44:16 -07:00
Charlie Zhao 32937d6aa4
gh-103109: Document ignore_warnings() test support helper (#103110)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2023-04-03 00:18:25 +02:00
Giampaolo Rodola 6883007a86
bpo-4080: unittest durations (#12271) 2023-04-03 00:12:51 +02:00
Alex Waygood 6d59c9e32e
gh-102433: Use `inspect.getattr_static` in `typing._ProtocolMeta.__instancecheck__` (#103034) 2023-04-02 14:22:19 +01:00
Irit Katriel 06249ec89f
gh-102192: deprecate _PyErr_ChainExceptions (#102935) 2023-04-01 21:30:23 +01:00
James De Bias b0422e140d
gh-102871: Remove obsolete browsers from webbrowser (#102872) 2023-03-31 11:02:47 -04:00
Furkan Onder 048d6243d4
GH-84783: Mention Author for GH-101264 (make slices hashable) (#103146)
Will Bradshaw contributed original patch on bpo-40603.
---------

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-03-31 09:54:17 -04:00
Petr Viktorin f6405a4662
Quote literal tokens in standard format specifier grammar (GH-102902)
Reported by Damian Dureck: https://mail.python.org/archives/list/docs@python.org/thread/UZTWBJIXC3MBKTHXVTIBPGDPKBNWZ5LN/
2023-03-31 14:40:38 +02:00
Hugo van Kemenade 20c0f196ff
gh-101100: Expand list of clean docs (GH-103135)
Follow on from https://github.com/python/cpython/pull/103116.

Expand list of clean docs files from 3 to 181. These files have no Sphinx warnings, and their presence in this list means that any new warnings introduced will fail the build.

The list was created by subtracting the list of files with warnings from a list of all files.

I tested with all of those, but found that `touch`ing two clean files (https://github.com/python/cpython/blob/main/Doc/includes/wasm-notavail.rst and https://github.com/python/cpython/blob/main/Doc/whatsnew/changelog.rst) caused a cascade effect and resulted in a number of dirty files being rebuilt too, and failing the build. So those two have been omitted.

Automerge-Triggered-By: GH:hugovk
2023-03-31 03:48:46 -07:00
gaogaotiantian c1e71ce56f
Minor docs improvements fix for `codeop` (#103123) 2023-03-30 15:51:36 -07:00
Hugo van Kemenade f192a558f5
gh-101100: Fix Sphinx warning in gc.rst and refactor docs clean list (#103116)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2023-03-30 21:03:50 +03:00
Shantanu fda95aa194
gh-103099: Link mypy docs from typing.rst (#103100) 2023-03-30 01:32:09 -07:00
Matěj Cepl d835b3f05d
gh-102582: Fix invalid JSON in Doc/howto/logging-cookbook.rst (GH-102635) 2023-03-29 09:52:53 +01:00
gaogaotiantian 027223db96
Update pdb docs for arguments (#102965) 2023-03-25 14:31:45 -07:00
Peter Jiping Xie 0708437ad0
gh-103025: fix two ctypes doc issues (#103026) 2023-03-25 09:12:00 +00:00
JakobDev 64cb1a4f0f
gh-100131: Add optional delete parameter to tempfile.TemporaryDirectory() (#100132)
Add optional delete parameter to tempfile.TemporaryDirectory().

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-03-24 14:52:06 -07:00
Amin Alaee f2e5a6ee62
gh-102873: logging.LogRecord docs: improve description of `msg` parameter (#102875)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-03-24 15:00:32 +00:00
Hugo van Kemenade 6a1c49a717
gh-101100: Test docs in nit-picky mode (#102513)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2023-03-24 13:23:35 +02:00
MonadChains 413b7db8a4
gh-94684: uuid: support bytes in the name argument to uuid3/5 (#94709)
RFC 4122 does not specify that name should be a string, so for completness the functions should also support a name given as a raw byte sequence.
2023-03-23 17:42:43 -06:00
Brandt Bucher 0444ae2487
GH-100982: Break up COMPARE_AND_BRANCH (GH-102801) 2023-03-23 15:25:09 -07:00
Raymond Hettinger 16f6165b71
Minor readability improvement to the factor() recipe (GH-102971) 2023-03-23 14:46:15 -05:00
Nikita Sobolev b6132085ca
gh-98239: Document that `inspect.getsource()` can raise `TypeError` (#101689) 2023-03-23 19:35:02 +00:00
Alex Waygood 58d2b30c01
gh-102936: typing: document performance pitfalls of protocols decorated with `@runtime_checkable` (#102937) 2023-03-23 18:18:53 +00:00
Raymond Hettinger 4695709143
Move binomialvariate() to a section for discrete distributions (GH-102955) 2023-03-23 12:10:12 -05:00
JosephSBoyle f13fdacadf
gh-102810 Improve the sphinx docs for `asyncio.Timeout` (#102934)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-03-23 16:43:13 +00:00
Erlend E. Aasland 08254be6c5
Docs: fixup incorrect escape char in sqlite3 docs (#102945) 2023-03-23 14:21:32 +01:00
Jens-Hilmar Bradt 8709697292
[doc] Fix error in tutorial example: type(exc) is the type rather than the instance (#102751) 2023-03-22 18:43:41 +00:00
Kevin Kirsche 9b19d3936d
gh-102921: [doc] Clarify `exc` argument name in `BaseExceptionGroup` is plural (#102922) 2023-03-22 18:14:05 +00:00
Irit Katriel 3468c768ce
gh-102859: Remove JUMP_IF_FALSE_OR_POP and JUMP_IF_TRUE_OR_POP (#102870) 2023-03-22 18:10:48 +00:00
Kristján Valur Jónsson 04adf2df39
gh-102780: Fix uncancel() call in asyncio timeouts (#102815)
Also use `raise TimeOut from <CancelledError instance>` so that the CancelledError is set
in the `__cause__` field rather than in the `__context__` field.

Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-03-22 10:52:10 -07:00
Benjamin Fogle af9c34f6ef
gh-96931: Fix incorrect results in ssl.SSLSocket.shared_ciphers (#96932) 2023-03-22 15:08:41 +01:00
Erlend E. Aasland 7b2d53dacc
Docs: improve accuracy of sqlite3.Connection.interrupt() (#102904)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2023-03-22 12:50:00 +01:00
Erlend E. Aasland c24f1f1e87
Docs: improve the accuracy of the sqlite3.connect() timeout param (#102900)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2023-03-22 12:37:13 +01:00
gaogaotiantian e0c63b7267
Docs: improve accuracy of pdb alias example (#102892) 2023-03-22 12:34:52 +01:00
David Poirier 41ef502d74
Add link to `sys.exit` function documentation (#102805)
* Add link to `sys.exit` function documentation

* Update Doc/library/os.rst

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>

* Update Doc/library/os.rst

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

---------

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2023-03-22 06:58:31 +09:00
Raymond Hettinger 0214c7ad90
Tweak polynomial itertool recipes (GH-102880) 2023-03-21 13:21:57 -05:00
wim glenn 4bb1dd3c5c
gh-102876: remove superfluous parens from itertools.batched recipe (GH-102877)
remove superfluous parens from itertools.batched recipe
2023-03-21 12:06:18 -05:00
Nikita Sobolev 910a64e301
gh-102595: Document `PyObject_Format` c-api function (GH-102596)
Def: 5ffdaf748d/Include/abstract.h (L389)
2023-03-21 09:46:24 -07:00
Irit Katriel 7f760c2fca
gh-102828: emit deprecation warning for onerror arg to shutil.rmtree (#102850) 2023-03-21 11:08:46 +00:00
Raymond Hettinger 1a5a14183e
The pow() variant further improves accuracy (GH-102866) 2023-03-21 00:02:14 -05:00
Raymond Hettinger 4075fe1d8d
Remove itermediate list. Expand docstring. (GH-102862) 2023-03-20 20:40:04 -05:00
Raymond Hettinger 094cf392f4
Add itertool recipe for polynomial evaluation. (GH-102852) 2023-03-20 17:14:29 -05:00
Eric Snow 28d369e070
gh-102304: Add a What's New Entry About _Py_RefTotal (gh-102845)
https://github.com/python/cpython/issues/102304
2023-03-20 10:35:49 -06:00
Alan Williams 5e6661bce9
gh-72346: Added isdst deprecation warning to email.utils.localtime (GH-91450) 2023-03-19 19:20:20 -05:00
Irit Katriel d51a6dc28e
gh-102828: add onexc arg to shutil.rmtree. Deprecate onerror. (#102829) 2023-03-19 18:33:51 +00:00
Irit Katriel e1e9bab006
gh-102778: Add sys.last_exc, deprecate sys.last_type, sys.last_value,sys.last_traceback (#102779) 2023-03-18 11:47:11 +00:00
Kumar Aditya 4f5774f648
GH-78530: add support for generators in `asyncio.wait` (#102761) 2023-03-17 06:58:43 +05:30
Irit Katriel 3f9285a8c5
gh-102755: Add PyErr_DisplayException(exc) (#102756) 2023-03-16 22:18:04 +00:00
Mark Dickinson 405739f916
Fix outdated note about 'int' rounding or truncating (#102736) 2023-03-16 20:34:42 +00:00
Steve Dower 0f175766e2
gh-99726: Improves correctness of stat results for Windows, and uses faster API when available (GH-102149)
This deprecates `st_ctime` fields on Windows, with the intent to change them to contain the correct value in 3.14. For now, they should keep returning the creation time as they always have.
2023-03-16 17:27:21 +00:00
Kumar Aditya adaed17341
GH-102748: remove legacy support for generator based coroutines from `asyncio.iscoroutine` (#102749)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-03-16 20:28:10 +05:30
Raymond Hettinger b0ec6253c9
GH-102653: Make recipe docstring show the correct distribution (#102742) 2023-03-16 09:32:18 -05:00
Julien Palard 61b9ff35cb
gh-101100: Documenting --prefix and --exec-prefix. (GH-102695)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-03-15 16:10:03 +01:00
Tom Levy 8647ba4b63
Remove misformatted exclamation marks in docs (#102694)
Remove the exclamation mark from :program:`!foo` in .rst files because
it inadvertently shows up in the rendered HTML.

(Sphinx's cross-referencing roles use a '!' prefix to suppress
hyperlinking[1], but :program: is not a cross-referencing role so the
'!' is displayed verbatim.)

The exclamation marks in venv.rst were introduced in #98350. See
comments [2] and [3] for additional discussion.

[1]: https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#cross-referencing-syntax
[2]: https://github.com/python/cpython/pull/98350#issuecomment-1285965759
[3]: https://github.com/python/cpython/pull/98350#issuecomment-1286394047

Reported-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
2023-03-15 09:06:32 +02:00
Robert Prater (B. Eng) 0a539b5db3
gh-102703: Fix typo in modules tutorial documentation (GH-102707)
**Before**
This prevents directories with a common name, such as ``string``, unintentionally hiding ...
**After**
This prevents directories with a common name, such as ``string``, from unintentionally hiding ...
2023-03-14 17:03:43 -07:00
Irit Katriel 152292b98f
gh-101578: mention in what's new in 3.12 that exceptions are now normalized before stored (#102702) 2023-03-14 22:38:15 +00:00
Paul Watson 80abd62647
gh-102354: change python3 to python in docs examples (#102696) 2023-03-14 12:40:12 -06:00
T 88c262c086
gh-100315: clarification to `__slots__` docs. (#102621)
refer to tp_itemsize in discussion on "variable-length" built-in types
2023-03-14 09:23:52 +00:00
Joongi Kim 7bdb331b67
doc: Remove a duplicate 'versionchanged' in library/asyncio-task (gh-102677) 2023-03-14 11:07:59 +09:00
Jacob Bower cbd3fbfb6e
gh-102013: Add PyUnstable_GC_VisitObjects (#102014) 2023-03-14 01:35:54 +00:00
Blind4Basics 61479d4684
gh-102627: Replace address pointing toward malicious web page (#102630)
* Replace known bad address pointing toward a malicious web page.

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-03-13 15:35:37 -07:00
Hugo van Kemenade 78e4e6c3d7
gh-101100: Fix Sphinx warnings in `turtle` module (#102340)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2023-03-13 11:24:52 +02:00
Виталий Дмитриев f6ca71a422
Fix duplicated words in the docs (GH-102629)
With grep utility found some duplicated words

Automerge-Triggered-By: GH:AlexWaygood
2023-03-12 11:03:59 -07:00
Guido van Rossum e6210621be
Fixes duplicated word (#102623)
In line 1627, the end of the sentence reads "only that that it may be." but it should read "only that it may be" (or alternatively "only that that may be").

Co-authored-by: Hugo Gabriel Eyherabide <hugogabriel.eyherabide@gmail.com>
2023-03-12 09:58:02 -07:00
Thomas Krennwallner ced13c96a4
gh-79940: add introspection API for asynchronous generators to `inspect` module (#11590) 2023-03-11 18:49:40 +05:30
Brandt Bucher 08b67fb34f
GH-90997: Shrink the LOAD_GLOBAL caches (#102569) 2023-03-10 17:01:16 -08:00
Nikita Sobolev b48be8fa18
gh-102103: add `module` argument to `dataclasses.make_dataclass` (#102104) 2023-03-10 17:26:46 -07:00
Steve Dower 12226bec25
gh-102519: Add doc updates for os.listdrives, listvolumes and listmounts (GH-102585) 2023-03-10 15:41:32 +00:00
Owain Davies 53dceb53ad
gh-86509: Add link to Lib/_threading_local.py in threading docs (#101824) 2023-03-10 13:22:02 +01:00
Steve Dower cb35882773
gh-102519: Add os.listdrives, os.listvolumes and os.listmounts on Windows (GH-102544) 2023-03-10 12:21:37 +00:00
T. Wouters 58d761e5b5
GH-84783: Document GH-101264 (Make the slice object hashable) in What's New. (#102548) 2023-03-08 18:39:33 -08:00
sblondon 7d801f245e
Remove or update bitbucket links (GH-101963)
Since Mercurial removal from bitbucket.org, some links are broken.
They are replaced by github.com or webarchive.org links if available. Otherwise, they are removed.

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2023-03-08 11:24:39 +01:00
Nikita Sobolev 1f557f94c2
gh-101100: Fix sphinx warnings in `zipapp` and `zipfile` modules (#102526) 2023-03-08 08:19:05 +00:00
Marcin Wieczorek 061325e0d2
Fix style in argparse.rst (#101733) 2023-03-07 23:25:28 -08:00
Carl Meyer 1e703a4733
gh-102381: don't call watcher callback with dead object (#102382)
Co-authored-by: T. Wouters <thomas@python.org>
2023-03-07 17:10:58 -07:00
C.A.M. Gerlach 4a3ea1fdd8
gh-95913: Consolidate build requirements changes in 3.11 WhatsNew (GH-98781)
Apply suggestion to combine build requirements changes in 3.11 WhatsNew

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2023-03-07 15:38:31 +01:00
C.A.M. Gerlach 80b19a30c0
gh-95913: Edit Faster CPython section in 3.11 WhatsNew (GH-98429)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2023-03-07 10:45:52 +08:00
Rémi Lapeyre d959bcd4a0
Add gettext support to tools/extensions/c_annotations.py (#101989) 2023-03-06 23:20:52 +02:00
Hyunkyun Moon d3ca042c99
gh-95672: Fix versionadded indentation of get_pagesize in test.rst (gh-102455) 2023-03-06 22:56:19 +09:00
Barney Gale 6716254e71
GH-101362: Optimise PurePath(PurePath(...)) (GH-101667)
The previous `_parse_args()` method pulled the `_parts` out of any supplied `PurePath` objects; these were subsequently joined in `_from_parts()` using `os.path.join()`. This is actually a slower form of joining than calling `fspath()` on the path object, because it doesn't take advantage of the fact that the contents of `_parts` is normalized!

This reduces the time taken to run `PurePath("foo", "bar")` by ~20%, and the time taken to run `PurePath(p, "cheese")`, where `p = PurePath("/foo", "bar", "baz")`, by ~40%.

Automerge-Triggered-By: GH:AlexWaygood
2023-03-05 15:50:21 -08:00
Sergey B Kirpichev 5da379ca7d
Move around example in to_bytes() to avoid confusion (#101595)
Moves an example to be closer to the sentence that refers to it.
2023-03-05 09:31:56 +00:00
Matthias Görgens eff9f43924
gh-96821: Add config option `--with-strict-overflow` (#96823)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Shantanu <hauntsaninja@gmail.com>
2023-03-04 13:39:52 -08:00
Wagner Alberto cb944d0be8
Add import of `unittest.mock.Mock` in documentation (#102346) 2023-03-03 22:55:31 +05:30
Nikita Sobolev 7b9132057d
gh-102383: [docs] Arguments of `PyObject_CopyData` are `PyObject *` (#102390) 2023-03-03 22:46:50 +05:30
Owain Davies 4e7c0cbf59
gh-101754: Document that Windows converts keys in `os.environ` to uppercase (GH-101840) 2023-03-03 10:51:32 +00:00
Michael K 73250000ac
Fix typos in documentation and comments (GH-102374)
Found some duplicate `to`s in the documentation and some code comments and fixed them.


[Misc/NEWS.d/3.12.0a1.rst](ed55c69ebd/Misc/NEWS.d/3.12.0a1.rst) also contains two duplicate `to`s, but I wasn't sure if it's ok to touch that file.  Looks auto generated.  I'm happy to amend the PR if requested. :)

Automerge-Triggered-By: GH:AlexWaygood
2023-03-02 07:26:49 -08:00
Stefan Pochmann eaae563b68
gh-102088 Optimize iter_index itertools recipe (GH-102360) 2023-03-01 21:16:23 -06:00
Hyunkyun Moon 2f62a5da94
gh-95672 skip fcntl when pipesize is smaller than pagesize (gh-102163) 2023-03-01 23:56:19 +09:00
Inada Naoki 7d1d663418
Doc: Fix minor error in ePub (GH-100614)
Fix issue reported https://mail.python.org/archives/list/docs@python.org/message/KE7OIAO53P4XRC4ZOWPDHA63ZQJCHEC3/
2023-03-01 09:48:15 +09:00
Furkan Onder 85b1fc1fc5
GH-90744: Fix erroneous doc links in the sys module (#101319)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-02-28 13:43:00 +02:00
Petr Viktorin 6b2d7c0ddb
gh-101101: Unstable C API tier (PEP 689) (GH-101102) 2023-02-28 09:31:01 +01:00
Steven Troxler 0f89acf6cc
gh-101561: Add typing.override decorator (#101564)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-02-27 13:16:11 -08:00
Sergey B Kirpichev 4624987b29
gh-101825: Clarify that as_integer_ratio() output is always normalized (#101843)
Make docstrings for `as_integer_ratio` consistent across types, and document that
the returned pair is always normalized (coprime integers, with positive denominator).

---------

Co-authored-by: Owain Davies <116417456+OTheDev@users.noreply.github.com>
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
2023-02-27 19:11:28 +00:00
Gouvernathor 0db6f44259
gh-102296 Document that inspect.Parameter kinds support ordering (GH-102297)
Automerge-Triggered-By: GH:AlexWaygood
2023-02-27 07:13:18 -08:00
Nikita Sobolev 101a12c576
gh-101100: Fix sphinx warnings in `types` module (#102274)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-02-27 07:26:21 +00:00
Rotzbua f3cb15c88a
gh-91038: Change default argument value to `False` instead of `0` (#31621)
The argument is used as a switch and corresponds to a boolean logic. Therefore it is more intuitive to use the corresponding constant `False` as default value instead of the integer `0`.

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2023-02-26 18:10:34 -08:00
VMan 6daf42b28e
[doc] Improve grammar/fix missing word (GH-102060) 2023-02-26 18:45:27 +05:30
Skip Montanaro bcadcde712
gh-102259: Fix re doc issue regarding right square brackets (#102264)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-02-25 21:22:16 -05:00
Nikita Sobolev a498de4c0e
gh-101100: Fix sphinx warnings in `typing` module docs (#102260) 2023-02-25 21:48:00 +00:00
Jelle Zijlstra 207e1c5cae
asyncio docs: Fix dangling hyphen (#102227)
Currently this gets rendered with a dangling hyphen.
2023-02-25 05:21:32 -08:00
Hugo van Kemenade b7c1126447
gh-101100: Fix Sphinx warnings in `decimal` module (#102125)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2023-02-25 11:42:45 +02:00
Stefan Pochmann 81bf10e4f2
gh-102105 Fix wording in filterfalse/quantify/filter (GH-102189) 2023-02-24 10:13:05 -06:00
Yeojin Kim 347f7406df
gh-81652: Add MAP_ALIGNED_SUPER FreeBSD and MAP_CONCEAL OpenBSD constants (gh-102191) 2023-02-24 19:26:51 +09:00
Tanner Firl 9bba8035bd
Fix typo in `Py_GetPythonHome` signature (#102168) 2023-02-23 18:58:33 +05:30
Erlend E. Aasland 5b9573eed4
gh-101578: Fixup NEWS and add What's New entry for new exception APIs (#102157) 2023-02-23 13:19:21 +01:00
Carl Meyer 056dfc71dc
gh-87634: remove locking from functools.cached_property (GH-101890)
Remove the undocumented locking capabilities of functools.cached_property.
2023-02-22 17:49:22 -08:00
Terry Jan Reedy 8f647477f0
Fix syntax error in struct doc example (#102160)
Missing closing ) reported on Discuss by Chukwudi Nwachukwu.
2023-02-22 18:55:03 -05:00
Owain Davies 96bf24380e
GH-101777: `queue.rst`: use 2 spaces after a period to be consistent. (#102143) 2023-02-22 14:21:38 -06:00
somebody 8d46c7ed5e
gh-102135: Update turtle docs to rename wikipedia demo to rosette (#102137) 2023-02-22 12:11:30 +02:00
ram vikram singh b40dd71241
gh-100556: Improve clarity of `or` docs (#100589)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-02-21 11:34:56 +01:00
Owain Davies 350ba7c07f
gh-101777: Make `PriorityQueue` docs slightly clearer (#102026)
Adjust wording slightly, and use min(entries) instead of
sorted(list(entries))[0] as an example.
2023-02-21 11:24:33 +01:00
Erlend E. Aasland 02d9f1504b
gh-101578: Amend exception docs (#102057)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2023-02-21 09:15:49 +01:00
Irit Katriel 4d3bc89a3f
gh-102011: use sys.exception() instead of sys.exc_info() in docs where possible (#102012) 2023-02-20 21:54:19 +00:00
Filipe Laíns 84181c1404
GH-99818: improve the documentation for zipfile.Path and Traversable (GH-101589)
Automerge-Triggered-By: GH:FFY00
2023-02-20 11:21:10 -08:00
Erlend E. Aasland 60bbed7f17
gh-101578: Amend PyErr_{Set,Get}RaisedException docs (#101962)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2023-02-19 21:22:29 +01:00
Raymond Hettinger 3b264df470
Misc improvements to the float tutorial (GH-102052) 2023-02-19 13:21:37 -06:00
Mark Dickinson b513c46d99
gh-85417: Clarify behaviour on branch cuts in cmath module (#102046)
This PR updates the cmath module documentation to reflect the reality that Python is almost always (and as far as I can tell, that "almost" can be omitted) running on a machine whose C double supports signed zeros.

* Removes misleading references to functions being continuous from above / below / the left / the right at branch cuts
* Expands the note on branch cuts at the top of the module documentation to explain the double-sided sign-of-zero-based behaviour
2023-02-19 19:15:44 +00:00
neuralstring 32df540635
gh-100425: Update tutorial docs related to sum() accuracy (FH-101854) 2023-02-19 10:39:03 -06:00
Patricio Paez 6aab56f3c2
gh-99735: Use required=True in argparse subparsers example (#100927) 2023-02-18 17:06:03 -08:00
Reza Rastak 36b670908b
Fix incorrectly documented attribute in csv docs (#101250) 2023-02-18 16:55:43 -08:00
Furkan Onder 61f1e67c6f
GH-84783: Make the slice object hashable (GH-101264) 2023-02-18 18:22:02 -06:00
Nikita Sobolev af446bbb76
gh-101536: [docs] Improve attributes of `urllib.error.HTTPError` (#101612)
* gh-101536: [docs] Improve attributes of `urllib.error.HTTPError`

* Address review
2023-02-18 12:46:33 -03:00
Owain Davies 7f1c721756
gh-101739: [Enum] update docs - default boundary for Flag is CONFORM (GH-101746) 2023-02-17 13:36:47 -08:00
Jan Gosmann 77d95c8373
gh-100226: Clarify StreamReader.read behavior (#101807) 2023-02-17 13:01:26 -08:00
Dustin Rodrigues a1723caabf
gh-101992: update plistlib examples to be runnable (#101994)
* gh-101992: update plistlib examples to be runnable

* Update Doc/library/plistlib.rst

---------

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-02-17 14:30:29 -05:00
Yeojin Kim 3c0a31cbfd
Docs: fix typos in PyFunction_WatchCallback docs and in 3.12 NEWS (GH-101980)
- possitibility => possibility
- disaallowed => disallowed
2023-02-17 00:47:02 -08:00
Oleg Iarygin a3bb7fbe7e
gh-101973: Fix parameter reference for PyModule_FromDefAndSpec (#101976) 2023-02-17 09:43:07 +01:00
sblondon 924a3bfa28
gh-93573: Replace wrong example domains in configparser doc (GH-93574)
* Replace bitbucket.org domain by forge.example
* Update example to python.org
* Use explicitly invalid domain

topsecret.server.com domain is not controled by PSF. It's replaced by invalid topsecret.server.example domain. It follows RFC 2606, which advise .example as TLD for documentation.
2023-02-16 16:13:21 +01:00
Rayyan Ansari 739c026f44
gh-101881: Support (non-)blocking read/write functions on Windows pipes (GH-101882)
* fileutils: handle non-blocking pipe IO on Windows

Handle erroring operations on non-blocking pipes by reading the _doserrno code.
Limit writes on non-blocking pipes that are too large.

* Support blocking functions on Windows

Use the GetNamedPipeHandleState and SetNamedPipeHandleState Win32 API functions to add support for os.get_blocking and os.set_blocking.
2023-02-16 14:52:24 +00:00
Erlend E. Aasland c1ce0d178f
gh-99138: Isolate _zoneinfo (#99218)
* Convert zone info type to heap type and add it to module state
* Add global variables to module state
2023-02-15 22:58:48 +01:00
Erlend E. Aasland 8a2b7ee64d
gh-101693: In sqlite3, deprecate using named placeholders with parameters supplied as a sequence (#101698) 2023-02-15 06:27:16 +01:00
Irit Katriel 81e3aa835c
gh-101799: implement PREP_RERAISE_STAR as an intrinsic function (#101800) 2023-02-14 11:54:13 +00:00
Furkan Onder 3690688149
GH-101898: Fix missing term references for hashable definition (#101899)
Fix missing term references for hashable definition
2023-02-14 14:20:11 +04:00
Steve Kowalik a1f08f5f19
Correct trivial grammar in reset_mock docs (#101861) 2023-02-13 11:11:43 +02:00
Jean Abou-Samra 6ef6915d35
gh-101845: pyspecific: Fix i18n for availability directive (GH-101846)
pyspecific: Fix i18n for availability directive

If the directive has content, the previous code would nest paragraph
nodes from that content inside a general paragraph node, which confuses
Sphinx and leads it to drop the content when translating. Instead, use a
container node for the body.

Also use set_source_info so that any warnings have location info.
2023-02-12 15:20:11 +01:00
busywhitespace 17143e2c30
gh-101390: Fix docs for `imporlib.util.LazyLoader.factory` to properly call it a class method (GH-101391) 2023-02-10 15:29:24 -08:00
Hugo van Kemenade 61f2be0866
Docs: Fix getstatus() -> getcode() typos (#101296) 2023-02-10 20:46:12 +02:00
Erlend E. Aasland 2037ebf81b
Docs: use parameter list for sqlite3.Cursor.execute* (#101782)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-02-10 18:54:04 +01:00
Oleg Iarygin 6d92373f50
gh-101283: Fix 'versionchanged' for the shell=True fallback on Windows in 3.12 (GH-101728) 2023-02-09 17:36:24 +00:00
Mark Shannon ecfd2d37c5
GH-99293: Document that `Py_TPFLAGS_VALID_VERSION_TAG` shouldn't be used. (#GH-101736)
Document that Py_TPFLAGS_VALID_VERSION_TAG shouldn't be used.
2023-02-09 14:05:53 +01:00
Soumendra Ganguly 244d4cd9d2
gh-85984: Remove legacy Lib/pty.py code. (#92365)
Refactored the implementation of pty.fork to use os.login_tty.

A DeprecationWarning is now raised by pty.master_open() and pty.slave_open(). They were
undocumented and deprecated long long ago in the docstring in favor of pty.openpty.

Signed-off-by: Soumendra Ganguly <soumendraganguly@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-02-08 17:00:17 -08:00
Steve Dower 0e0c5d8baa
gh-101283: Version was just released, so should be changed in 3.11.3 (GH-101719) 2023-02-08 23:52:03 +00:00
Oleg Iarygin 23751ed826
gh-101283: Improved fallback logic for subprocess with shell=True on Windows (GH-101286) 2023-02-08 22:12:19 +00:00
Mark Shannon feec49c407
GH-101578: Normalize the current exception (GH-101607)
* Make sure that the current exception is always normalized.

* Remove redundant type and traceback fields for the current exception.

* Add new API functions: PyErr_GetRaisedException, PyErr_SetRaisedException

* Add new API functions: PyException_GetArgs, PyException_SetArgs
2023-02-08 09:31:12 +00:00
Stanley 027adf42cd
gh-47937: Note that Popen attributes are read-only (#93070)
* Note that Popen attributes aren't meant to be set by users by rewording the text about the attributes.
* Also update some universal_newlines references to mention the modern text parameter name while in the area.

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-02-08 00:12:46 -08:00
penguin_wwy 753fc8a5d6
gh-101632: Add the new RETURN_CONST opcode (#101633) 2023-02-07 22:32:21 +00:00
Oleg Iarygin f87f6e2396
gh-97725: Fix documentation for the default file of `asyncio.Task.print_stack` (#101652) 2023-02-07 23:34:31 +05:30
Oleg Iarygin a687ae9eb5
Fix nesting of 'Pending Removal in Python 3.14' (#101637) 2023-02-07 16:54:47 +02:00
Hugo van Kemenade a757d72127
Doctest: Pin sphinxext-opengraph==0.7.5 to prevent importing NumPy (#101642) 2023-02-07 14:59:26 +01:00
Brian Skinn c4de6b1d52
gh-85747: Active voice & suggested edits, 'running/stopping loop' & 'callbacks' subsections of asyncio-eventloop.rst (#100270)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-02-06 21:25:42 -08:00
Mariatta Wijaya 949c58f945
GH-101616: Mention the Docs Discourse forum in the "reporting docs issues" (GH-101617)
Fixes https://github.com/python/cpython/issues/101616
2023-02-06 13:59:45 -08:00
mrh1997 f7e9fbacb2
bpo-33591: Add support for path like objects to `ctypes.CDLL` (#7032)
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2023-02-05 23:06:57 +05:30
Eric Wieser 90d85a9b41
gh-76961: Fix the PEP3118 format string for ctypes.Structure (#5561)
The summary of this diff is that it:

* adds a `_ctypes_alloc_format_padding` function to append strings like `37x` to a format string to indicate 37 padding bytes
* removes the branches that amount to "give up on producing a valid format string if the struct is packed"
* combines the resulting adjacent `if (isStruct) {`s now that neither is `if (isStruct && !isPacked) {`
* invokes `_ctypes_alloc_format_padding` to add padding between structure fields, and after the last structure field. The computation used for the total size is unchanged from ctypes already used.

This patch does not affect any existing aligment computation; all it does is use subtraction to deduce the amount of paddnig introduced by the existing code.

---

Without this fix, it would never include padding bytes - an assumption that was only
valid in the case when `_pack_` was set - and this case was explicitly not implemented.

This should allow conversion from ctypes structs to numpy structs

Fixes https://github.com/numpy/numpy/issues/10528
2023-02-05 17:10:53 +00:00
Mark Dickinson 0672a6c23b
Revert "gh-89381: Fix invalid signatures of math/cmath.log (#101404)" (#101580)
This reverts commit 0ef92d9793.
2023-02-05 16:36:33 +00:00
busywhitespace 9b60ee976a
gh-101221: Add options in the documentation of timeit command (#101222) 2023-02-05 15:25:36 +05:30
alnoki 6e4a521c2a
Add missing preposition in argparse docs (#101548) 2023-02-05 15:15:07 +05:30
Furkan Onder cef9de62b8
GH-56426: Add cross-reference to the documentation for faulthandler, traceback, and pdb. (#101157)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2023-02-04 09:19:29 +05:30
Max Bachmann f11a3d1ebe
Add missing `versionadded` directive for `PyCode_Addr2Location` (#101347) 2023-02-04 09:03:28 +05:30
Gregory P. Smith d4c410f0f9
gh-84559: Remove the new multiprocessing warning, too disruptive. (#101551)
This reverts the core of #100618 while leaving relevant documentation
improvements and minor refactorings in place.
2023-02-03 15:20:46 -08:00
François Magimel 45d014e03b
docs: replace PyPI description with link (#101506) 2023-02-03 12:53:11 +05:30
Viet Than 5c39daf50b
gh-100920: Update documentation for `asyncio.StreamWriter.wait_closed` (#101514) 2023-02-03 12:48:39 +05:30
C.A.M. Gerlach 1b6045668d
gh-100925: Move array methods under class in array doc (#101485)
* Move array methods under class in array doc

* Fix a few internal references related to the touched lines
2023-02-03 08:03:27 +08:00
Gregory P. Smith 0ca67e6313
GH-84559: Deprecate fork being the multiprocessing default. (#100618)
This starts the process. Users who don't specify their own start method
and use the default on platforms where it is 'fork' will see a
DeprecationWarning upon multiprocessing.Pool() construction or upon
multiprocessing.Process.start() or concurrent.futures.ProcessPool use.

See the related issue and documentation within this change for details.
2023-02-02 15:50:35 -08:00
Peter Gessler 24cbc7a2a0
docs: Fix enum reassign `str` documentation (GH-101507) 2023-02-02 12:12:57 -08:00
Marcos Pereira ee21110086
Docs: improve accuracy of sqlite3 `check_same_thread` parameter (#101351)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2023-02-02 00:52:29 +01:00
Steve Dower eda60916bc
gh-101467: Correct py.exe handling of prefix matches and cases when only one runtime is installed (GH-101468) 2023-02-01 21:06:56 +00:00
Raj 95fb0e0258
gh-101498 : Fix asyncio.Timeout example in docs (#101499)
Doc/library/asyncio-task.rst#timeout
2023-02-01 10:08:31 -08:00
Irit Katriel 62251c3da0
gh-101454: fix documentation for END_ASYNC_FOR (#101455) 2023-02-01 12:49:59 +00:00
beavailable cc407b9de6
gh-101317: Add `ssl_shutdown_timeout` parameter for `asyncio.StreamWriter.start_tls` (#101335)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2023-02-01 16:33:59 +05:30
John Belmonte 75227fba1d
datetime.rst: fix combine() signature (#101490)
The default `tzinfo` param of the `combine()` signature pseudocode was erroneously `self.tzinfo`.

`self` has no meaning in the context of a classmethod, and the datetime class itself has no `tzinfo` attribute.  The correct default pseudocode is `time.tzinfo`, reflecting that the default is the `tzinfo` attribute of the `time` parameter.
2023-02-01 14:01:28 +04:00
Peter Jiping Xie 20c11f2e60
gh-101440: fix json snippet error in logging-cookbook.rst (#101439) 2023-01-31 17:30:38 +02:00
Raj df0068ce48
gh-99276 - Updated Doc/faq/general.rst (#101396)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-01-31 17:16:17 +02:00
Christophe Nanteuil 1a62ae84c6
Add JOBS parameter to docs Makefile (#101395) 2023-01-31 15:29:29 +02:00
Shantanu 909a674693
gh-77607: Improve accuracy of os.path.join docs (#101406)
This is a follow-up to #100811.

One of the changes in that PR isn't accurate in that
`os.path.join('', '')` will not end in a separator.

This reverts that change to the previous wording that used "only", but
explicitly calls out the case where the last part ends in a separator,
which is what caused confusin in #77607 and motivated the change
in #100811.
2023-01-30 21:39:30 -08:00
Ben ef09bf63d2
Fixes typo in asyncio.TaskGroup context manager code example (#101449) 2023-01-30 21:36:40 -08:00
Owain Davies ea232716d3
gh-101422: (docs) TarFile default errorlevel argument is 1, not 0 (GH-101424) 2023-01-30 09:56:33 -08:00
Sergey B Kirpichev 0ef92d9793
gh-89381: Fix invalid signatures of math/cmath.log (#101404) 2023-01-29 11:50:10 -08:00
socal-nerdtastic 666c0840dc
Fix trivial typo in shebang example (GH-101385)
The example was showing the current version, but should be pinned to 3.7 to match the example command.
2023-01-28 15:18:04 +02:00
Peter Jiping Xie db757f0e44
gh-101386: fix typos found by codespell (#101387) 2023-01-28 11:57:40 +02:00
Gregory P. Smith 052f53d65d
gh-39615: Add warnings.warn() skip_file_prefixes support (#100840)
`warnings.warn()` gains the ability to skip stack frames based on code
filename prefix rather than only a numeric `stacklevel=` via a new
`skip_file_prefixes=` keyword argument.
2023-01-27 18:35:14 -08:00
Vinay Sajip b5c4d6064c
[doc] Add a section on logging handler configuration order. (GH-101380) 2023-01-27 19:01:30 +00:00
Vinay Sajip d083df39fa
[doc] Add some notices to logging configuration documentation. (GH-101373) 2023-01-27 14:50:09 +00:00
Barney Gale e5b08ddddf
gh-101000: Add os.path.splitroot() (#101002)
Co-authored-by: Eryk Sun <eryksun@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-01-27 00:28:27 +00:00
John Belmonte f5ad63f79a
datetime.rst: improve combine() docs (#101338)
The explanation on handling of datetime as the date arg was confusingly mixed with an unrelated
item, and lacked proper arg name formatting.
2023-01-26 11:25:43 +04:00
achhina 952a1d9cc9
GH-88597: Rename uuid's new CLI args to be in line with uuidgen. (#101248)
this way they match an existing uuidgen command line tool.
2023-01-25 09:39:42 -08:00
Mark Shannon f02fa64bf2
GH-100762: Don't call `gen.throw()` in `gen.close()`, unless necessary. (GH-101013)
* Store exception stack depth in YIELD_VALUE's oparg and use it avoid expensive gen.throw() in gen.close() where possible.
2023-01-24 17:25:37 +00:00
ram vikram singh 7f95ec3e74
gh-101152: Implement PEP 699 (GH-101193)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Ken Jin <kenjin@python.org>
2023-01-24 17:29:22 +08:00
Gregory P. Smith e244401ce5
[docs] Mention how to get/set a bigint PyLong via the C API (#101270)
We don't need direct C APIs to get at a bigint representation of PyLong but we
do want the few people who need to understand how.

Additional Author:  CAM-Gerlach
2023-01-23 21:20:53 -08:00
Carlton Gibson 5d868efde9
Added asyncio REPL example to docs. (#101243)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2023-01-23 17:01:13 +05:30
Jacob Walls d717be04dc
gh-83122: Deprecate testing element truth values in `ElementTree` (#31149)
When testing element truth values, emit a DeprecationWarning in all implementations.

This had emitted a FutureWarning in the rarely used python-only implementation since ~2.7 and has always been documented as a behavior not to rely on.

Matching an element in a tree search but having it test False can be unexpected. Raising the warning enables making the choice to finally raise an exception for this ambiguous behavior in the future.
2023-01-22 17:16:48 -08:00
Andrew Hong 8bcd4a6ec7
GH-101097: Switch from standard interval notation to greater or less than signs for random.random()'s documentation (#101119) 2023-01-22 14:58:36 -06:00
Mark Dickinson 3e09f3152e
gh-67790: Support float-style formatting for Fraction instances (#100161)
This PR adds support for float-style formatting for `Fraction` objects: it supports the `"e"`, `"E"`, `"f"`, `"F"`, `"g"`, `"G"` and `"%"` presentation types, and all the various bells and whistles of the formatting mini-language for those presentation types. The behaviour almost exactly matches that of `float`, but the implementation works with the exact `Fraction` value and does not do an intermediate conversion to `float`, and so avoids loss of precision or issues with numbers that are outside the dynamic range of the `float` type.

Note that the `"n"` presentation type is _not_ supported. That support could be added later if people have a need for it.

There's one corner-case where the behaviour differs from that of float: for the `float` type, if explicit alignment is specified with a fill character of `'0'` and alignment type `'='`, then thousands separators (if specified) are inserted into the padding string:

```python
>>> format(3.14, '0=11,.2f')
'0,000,003.14'
```

The exact same effect can be achieved by using the `'0'` flag:

```python
>>> format(3.14, '011,.2f')
'0,000,003.14'
```

For `Fraction`, only the `'0'` flag has the above behaviour with respect to thousands separators: there's no special-casing of the particular `'0='` fill-character/alignment combination. Instead, we treat the fill character `'0'` just like any other:

```python
>>> format(Fraction('3.14'), '0=11,.2f')
'00000003.14'
>>> format(Fraction('3.14'), '011,.2f')
'0,000,003.14'
```

The `Fraction` formatter is also stricter about combining these two things: it's not permitted to use both the `'0'` flag _and_ explicit alignment, on the basis that we should refuse the temptation to guess in the face of ambiguity. `float` is less picky:

```python
>>> format(3.14, '0<011,.2f')
'3.140000000'
>>> format(Fraction('3.14'), '0<011,.2f')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/mdickinson/Repositories/python/cpython/Lib/fractions.py", line 414, in __format__
    raise ValueError(
ValueError: Invalid format specifier '0<011,.2f' for object of type 'Fraction'; can't use explicit alignment when zero-padding
```
2023-01-22 18:44:49 +00:00
achhina 95f5b05a8c
GH-88597: Added command line interface to UUID module. (#99463)
The `uuid` module now supports command line usage.

```python
❯ ./python.exe -m uuid             
5f2d57b1-90e8-417c-ba5d-69b9b6f74289

❯ ./python.exe -m uuid -h          
usage: uuid.py [-h] [-u {uuid1,uuid3,uuid4,uuid5}] [-ns NAMESPACE] [-n NAME]
...
```
2023-01-21 22:59:31 -08:00
Kamil Turek b4e11a7985
gh-99266: ctypes: Preserve more detailed exception in `ArgumentError`
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2023-01-21 19:14:43 +05:30
scrazzz 120cb18c72
Fix rst formatting in 3.12 What's New (#101110) 2023-01-21 14:23:54 +05:30
Barney Gale 01093b8203
gh-86610: Use attribute directive in docs for pathlib.PurePath (#101114) 2023-01-20 23:13:58 +01:00
Jürgen Gmach 9a155138c5
GH-101111: Disambigaute origin of const for store_const and append_const (#101121)
While the documentation for `optparse` mentioned that both `store_const` and
`append_const` store a constant value, it was not clear where this value was
coming from.

A link to `Option.const` makes this explicit.
2023-01-20 23:13:07 +01:00