Commit Graph

26538 Commits

Author SHA1 Message Date
Richard Hajek 385d8d2b64
Removed unnecessary escaping of asterisks (#103714)
Removed unnecessary escaping of asterisks, as visible both on GitHub and in https://docs.python.org/3/library/decimal.html#decimal.localcontext

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2023-04-24 16:31:41 +00:00
Brett Simmers b7f4811c88
gh-103091: Add PyUnstable_Type_AssignVersionTag (#103095) 2023-04-24 10:07:47 -06:00
Alex Gaynor 543009347e
gh-103712: Increase the length of the type name in AttributeError messages (#103713) 2023-04-24 08:23:08 -06:00
Stanley 59c522f965
gh-44123: Add note on relative path for os.exec* (GH-93826)
Co-authored-by: Steve Dower <steve.dower@python.org>
2023-04-24 14:52:31 +01:00
Christopher Chavez 014f131934
Change 'dependant' to 'dependent' (#103745)
The word 'dependent' is both an adjective and a noun. A 'dependant' is a British alternative spelling for the noun form. In idlelib.sidebar, 'OS-dependant' is an adjective and clearly wrong. In 'Using', 'dependant' as a noun would be acceptable in Britain, but we use American spellings in Python docs.
https://www.merriam-webster.com/words-at-play/spelling-variants-dependent-vs-dependant
2023-04-24 09:40:30 -04:00
Petr Viktorin af53046995
gh-102950: Implement PEP 706 – Filter for tarfile.extractall (#102953) 2023-04-24 10:58:06 +02:00
James Hilton-Balfe 730bbddfdf
gh-101688: Implement types.get_original_bases (#101827)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-04-23 20:24:30 +01:00
Randy 7bf94568a9
gh-68654: Clarify subdirectories used by pkgutil.extend_path (#103701)
Clarify sub directories used by pkgutil.extend_path in the docs and the docstring
2023-04-22 17:33:50 -06:00
Hugo van Kemenade 8cb2b0f953
Revert "Avoid error lexing multiprocessing docs code block on Pygments 2.15.0" (#103616)
This reverts commit ace51dcdb7.
2023-04-22 15:41:58 -06:00
Eddie Elizondo ea2c001650
gh-84436: Implement Immortal Objects (gh-19474)
This is the implementation of PEP683

Motivation:

The PR introduces the ability to immortalize instances in CPython which bypasses reference counting. Tagging objects as immortal allows up to skip certain operations when we know that the object will be around for the entire execution of the runtime.

Note that this by itself will bring a performance regression to the runtime due to the extra reference count checks. However, this brings the ability of having truly immutable objects that are useful in other contexts such as immutable data sharing between sub-interpreters.
2023-04-22 13:39:37 -06:00
Eric Wieser 3d2a46845b
gh-83791: Raise TypeError for len(memoryview_0d) (#18463)
Changes the behaviour of `len` on a zero-dimensional `memoryview` to raise `TypeError`. Previously, `len` would return `1`.
2023-04-22 17:32:47 +01:00
Rafael Fontenelle caed49448d
GH-103484: Fix broken links reported by linkcheck (#103608)
* Doc: Fix broken links reported by linkcheck

* Apply suggestions from code review

- Remove extra diff line in faq/library.rst (merwok)
- Use HTTPS to link Unicode 15.0.0 to solve a redirect (hugovk)
- Use wayback machine link for openssl 1.1.0 instead of linking 1.1.1, "as this text mentions a feature from 1.1.0" (hugovk)

Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>

* Doc: Make mark-up code as literal

* Doc: Alphabetize items in linkcheck_ignore

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

* Doc: Improve comment in sphinx conf

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

---------

Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-04-22 08:24:47 -06:00
Raymond Hettinger e5eaac6064
GH-103475: cache() and lru_cache() do not have a "call once" guarantee (GH-103669) 2023-04-22 09:18:25 -05:00
Raymond Hettinger 7b134d3e71
Descriptor HowTo: Update to include attributes added in Python 3.10 (GH-103666) 2023-04-22 08:29:40 -05:00
Raymond Hettinger 7d20783d45
Minor improvements to the functools docs (#103672)
* Use an f-string for improved readability

* Put version notes in chronological order
2023-04-21 20:53:50 -05:00
Raymond Hettinger 0cb0871584
GH-103415: Document itertools.batched() in whatsnew.3.12 (#103670) 2023-04-21 20:52:37 -05:00
Jason R. Coombs 3e0fec7e07
Sync with importlib_metadata 6.5 (GH-103584) 2023-04-20 22:12:48 -04:00
Adrien 4898415df7
gh-98641: Document difference between task group and gather (#103644)
The purpose of the comments is to rule out the implication that asyncio.TaskGroup is a drop-in replacement / better alternative to asyncio.gather().
2023-04-20 07:07:41 -07:00
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