Commit Graph

26107 Commits

Author SHA1 Message Date
Beweeted 868bab0fdc
gh-100174: [Enum] Correct PowersOfThree example. (GH-100178)
Changed from multiples of 3 to powers of 3 to match the class name.
2022-12-11 15:20:59 -08:00
Brad Wolfe d5f8a2b6ad
gh-99728: correct typo in `datetime` format codes documentation (#99750) 2022-12-10 15:50:18 +05:30
busywhitespace e477348f36
gh-99970 Adding missing `optionflags` parameter in the documentation of `doctest` (#99971) 2022-12-10 15:42:40 +05:30
ram vikram singh 7c0fb71fbf
gh-100049: fix `repr` for `mappingproxy` in dictionary view example doc (#100052) 2022-12-10 14:46:00 +05:30
Stanley 286e3c76a9
gh-99087: Add missing newline for prompts in docs (GH-98993)
Add newline for prompts so copying to REPL does not cause errors.
2022-12-08 19:31:19 -08:00
Raymond Hettinger 35cc0ea736
GH-98363: Have batched() return tuples (GH-100118) 2022-12-08 15:08:16 -06:00
Jia Junjie 41d4ac9da3
gh-96250: Improve sqlite3 injection attack example (#99270)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2022-12-08 21:37:08 +01:00
Matthieu Baerts cce8362960
gh-98030: socket: add missing TCP socket options (#98031)
A few TCP socket options have been added to the Linux kernel these last
few years.

This commit adds all the ones available in Linux 6.0:

  https://elixir.bootlin.com/linux/v6.0/source/include/uapi/linux/tcp.h#L91

While at it, the TCP_FASTOPEN option has been moved lower in the list
just to keep the same order as in tcp.h to ease future synchronisations.

Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
2022-12-07 20:59:37 -08:00
Victor Stinner b11a384dc7
gh-98724: Fix Py_CLEAR() macro side effects (#99100) (#100070)
The Py_CLEAR(), Py_SETREF() and Py_XSETREF() macros now only evaluate
their arguments once. If an argument has side effects, these side
effects are no longer duplicated.

Use temporary variables to avoid duplicating side effects of macro
arguments. If available, use _Py_TYPEOF() to avoid type punning.
Otherwise, use memcpy() for the assignment to prevent a
miscompilation with strict aliasing caused by type punning.

Add _Py_TYPEOF() macro: __typeof__() on GCC and clang.

Add test_py_clear() and test_py_setref() unit tests to _testcapi.
2022-12-07 15:22:38 +01:00
Ethan Furman 679efbb080
gh-94943: [Enum] improve repr() when inheriting from a dataclass (GH-99740)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-12-06 13:43:41 -08:00
Serhiy Storchaka fd38a2f0ec
gh-93453: No longer create an event loop in get_event_loop() (#98440)
asyncio.get_event_loop() now always return either running event loop or
the result of get_event_loop_policy().get_event_loop() call. The latter
should now raise an RuntimeError if no current event loop was set
instead of creating and setting a new event loop.

It affects also a number of asyncio functions and constructors which
call get_event_loop() implicitly: ensure_future(), shield(), gather(),
etc.

DeprecationWarning is no longer emitted if there is no running event loop but
the current event loop was set.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2022-12-06 18:42:12 +01:00
Ashwin Ramaswami 85d5a7e8ef
bpo-37860: re-add netlify.toml to set up deploy previews for docs (#92852)
* Revert "bpo-46184: remove `netlify.toml` (#30272)"

This reverts commit fbaf2e604c.

* Delete runtime.txt

* Create runtime.txt

* Delete runtime.txt

* Update netlify.toml

* Update netlify.toml

* Add netlify badge

* Update Doc/tools/templates/layout.html

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

* Update layout.html

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2022-12-06 08:37:41 -05:00
Victor Stinner 5837e5f347
gh-100008: VS 2017 is required since Python 3.11 (#100045) 2022-12-06 14:35:32 +01:00
Erik De Bonte 5c19050546
gh-99957: Add `frozen_default` parameter on `dataclass_transform` (#99958) 2022-12-05 19:35:43 -08:00
Gregory P. Smith bed15f87ea
gh-100001: Remove doc typo, add versionadded (#100042)
gh-100001: Remove new doc typo, add versionadded.
2022-12-05 15:15:13 -08:00
Hugo van Kemenade f49c735e52
Use sphinxext-opengraph to generate OpenGraph metadata (#99931)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-12-05 23:26:28 +02:00
Gregory P. Smith d8ab0a4dfa
gh-100001: Omit control characters in http.server stderr logs. (#100002)
Replace control characters in http.server.BaseHTTPRequestHandler.log_message with an escaped \xHH sequence to avoid causing problems for the terminal the output is printed to.
2022-12-05 12:55:45 -08:00
Ram Rachum 51ee0a29e9
dataclasses.rst: Prevent horizontal scrolling (gh-100025) 2022-12-05 13:56:13 -05:00
Victor Stinner 5ea052bb0c
gh-100008: Document Python build requirements (#100009)
Document also configure --without-freelists option added to Python
3.11.
2022-12-05 15:41:44 +01:00
Ethan Furman e3a3863cb9
gh-93464: [Enum] Add versionchanged tag (#99997)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-12-05 12:35:31 +02:00
Géry Ogam 2ae894b6d1
[Enum] Fix typos in the documentation (GH-99960) 2022-12-04 11:49:31 -08:00
Brian Skinn bf26bdf6ac
gh-85747: "Preface" section of asyncio-eventloop.rst: Switch to active voice and suggest other edits (#99784) 2022-12-03 16:48:41 -08:00
Serhiy Storchaka a87c46eab3
bpo-15999: Accept arbitrary values for boolean parameters. (#15609)
builtins and extension module functions and methods that expect boolean values for parameters now accept any Python object rather than just a bool or int type. This is more consistent with how native Python code itself behaves.
2022-12-03 11:52:21 -08:00
Itamar Ostricher 3c137dc613
GH-91054: Add code object watchers API (GH-99859)
* Add API to allow extensions to set callback function on creation and destruction of PyCodeObject

Co-authored-by: Ye11ow-Flash <janshah@cs.stonybrook.edu>
2022-12-02 17:28:27 +00:00
C.A.M. Gerlach d460c8ec52
Doc: Add summary line to isolation_level & autocommit sqlite3.connect params (#99917)
Add summary lines to isolation_level and autocommit connect() params

Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
2022-12-01 08:19:41 +01:00
ram vikram singh e0f91deb59
GH-98906 ```re``` module: ```search() vs. match()``` section should mention ```fullmatch()``` (GH-98916)
Mention fullmatch along with search and match.
2022-11-30 17:52:21 -05:00
Géry Ogam 9628136fac
bpo-47220: Document the optional callback parameter of weakref.WeakMethod (GH-25491) 2022-11-30 13:44:10 -06:00
Géry Ogam 19c38801ba
gh-99824: Document that sqlite3.connect implicitly open a transaction if autocommit=False (#99825)
Authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-11-30 12:33:50 +01:00
Dong-hee Na 8bb2303fd7
gh-99127: Allow some features of syslog to the main interpreter only (gh-99128) 2022-11-30 07:58:20 +09:00
Géry Ogam 052bc128ac
Docs: improve accuracy of socketserver reference (#24767) 2022-11-29 21:34:52 +01:00
Yilei "Dolee" Yang d74a58872c
whatsnew-3.10: Mention PEP 647 in the Release highlights section. (#99853)
Mention PEP 647 in the Release highlights section.

Also re-ordered the list so it matches the order in the details sections below.
2022-11-29 20:30:58 +00:00
Sam Ezeh 05dfc539c2
gh-90717: Update the documentation for the altchars paremeter in base64 library (GH-94187) 2022-11-29 16:21:01 +00:00
Matthew Hughes ca3e611b1f
`fnmatch` docs: link to `fnmatch.filter()`, not `builtins.filter()` (#99819) 2022-11-28 18:08:08 +00:00
David Miguel Susano Pinto 65417988a5
Grammatical improvements for ctypes 'winmode' documentation (GH-19167) 2022-11-28 16:05:21 +00:00
Georg Brandl 492dc02b01
bpo-41825: restructure docs for the os.wait*() family (GH-22356) 2022-11-28 09:41:24 +00:00
Petr Viktorin 219696abb2
gh-99249: Clarify "read-only" slots tp_bases & tp_mro (GH-99342)
These slots are marked "should be treated as read-only" in the
table at the start of the document.  That doesn't say anything about
setting them in the static struct.

`tp_bases` docs did say that it should be ``NULL`` (TIL!). If you
ignore that, seemingly nothing bad happens. However, some slots
may not be inherited, depending on which sub-slot structs are present.
(FWIW, NumPy sets tp_bases and is affected by the quirk -- though to
be fair, its DUAL_INHERIT code probably predates tp_bases docs, and
also the result happens to be benign.)

This patch makes things explicit.
It also makes the summary table legend easier to scan.

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-11-28 09:22:08 +01:00
Erlend E. Aasland 276643e207
Docs: both sqlite3 "point examples" now adapt to str (#99823) 2022-11-27 22:08:30 +01:00
Sam Ezeh dfc2732a57
gh-91340: Document multiprocessing.set_start_method force parameter (GH-32339)
#91340


https://bugs.python.org/issue47184

Automerge-Triggered-By: GH:kumaraditya303
2022-11-27 09:58:39 -08:00
Hugo van Kemenade 969620d59a
Docs: Move .PHONY to each section to avoid copy/paste omissions (#99396) 2022-11-27 19:48:29 +02:00
Brad Wolfe 65629399bc
gh-85988: Change documentation for sys.float_info.rounds (GH-99675)
* Change documentation for sys.float_info.rounds

Change the documentation for sys.float_info.rounds to remove
references to C99 section 5.2.4.2.2 and instead place the
available values inline.

* Correction to previous documentation change

Newlines were not preserved in generated HTML on previous
commit. I have changes the list to a comma-separated list
of values and their meanings.

* Clarify source for value of FLT_ROUNDS

Clarify the source of the FLT_ROUNDS value and
change 'floating-point addition' to 'floating-point
arithmetic' to indicate that the rounding mode
applies to all arithmetic operations.
2022-11-27 10:25:12 +00:00
George Zhang 22860dbbc8
doc: Remove backslashes in doctest grammar docs (#29346) 2022-11-27 12:08:39 +05:30
Zackery Spytz 62a5dc13e9
bpo-43327: Fix the docs for PyImport_ImportFrozenModuleObject() (#24659)
The docs stated that PyImport_ImportFrozenModuleObject() returns a
new reference, but it actually returns an int.

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-11-27 11:57:41 +05:30
Jason R. Coombs 7f005749b2
gh-88330: Add more detail about what is a resource. (#99801) 2022-11-26 16:57:20 -05:00
busywhitespace 5f8898216e
gh-99795: Fix typo in importlib.resources.abc (GH-99796)
Changing TraversableReader to TraversableResources at one place of the documentation.

See #99795 for more details.
2022-11-26 10:01:08 -08:00
Nikita Sobolev 47d673d81f
gh-99502: mention bytes-like objects as input in `secrets.compare_digest` (GH-99512)
Now it is in sync with https://docs.python.org/3/library/hmac.html#hmac.compare_digest
It is the same function, just re-exported. So, I guess they should mention the same input types.
2022-11-26 01:33:48 -08:00
Terry Jan Reedy a86d854522
Fix typo in `__match_args__` doc (#99785)
A opy of #98549, whose author (@icecream17) uses a school computer that blocks the CLA site. I did not mention this in commit comment above so CLA bot does not pick up the name and request the CLA again.
2022-11-26 00:03:16 +00:00
Stanley 7d2dcc53d0
gh-64019: Have attribute table in `inspect` docs link to module attributes instead of listing them (GH-98116)
Co-authored-by: Michael Anckaert <michael.anckaert@sinax.be>
2022-11-25 11:10:22 -08:00
Erlend E. Aasland 8749121b07
gh-96168: Add sqlite3 row factory how-to (#99507)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2022-11-25 14:07:28 +01:00
Victor Stinner 3a803bcaac
Revert "gh-98724: Fix Py_CLEAR() macro side effects" (#99737)
Revert "gh-98724: Fix Py_CLEAR() macro side effects (#99100)"

This reverts commit c03e05c2e7.
2022-11-24 22:17:33 +01:00
Zachary Ware b5b3904f05
Fix rendering of audioop license in Doc/license.rst (GH-99752)
Also some cosmetic blank line additions for consistency with the
formatting of the rest of the file.
2022-11-24 10:18:40 -06:00