gh-104882: Docs: fix description of relationship between `socket.getblocking()` and `socket.gettimeout()` (GH-105026)
(cherry picked from commit 5a5ed7a3e6)
Co-authored-by: Joe Geisbauer <joegeisbauer@gmail.com>
gh-104984: remove kwargs and starargs from Call & ClassDef (GH-104986)
These fields are removed in 025e9ebd0a
(cherry picked from commit 61c1d6760f)
Co-authored-by: Shaygan Hooshyari <sh.hooshyari@gmail.com>
* gh-103606: Improve error message from logging.config.FileConfig (GH-103628)
(cherry picked from commit 152227b569)
plus backport the followup exception change fix to that in #104701
- AnyStr can be used in type annotations, contrary to the section header
- Unpack can also be used in annotations, and its use is not restricted
to generics. It makes more sense with other building blocks like Required.
- Protocol is not necessarily generic.
Also fix the indentation for two notes associated with Concatenate.
(cherry picked from commit ab71acd67b)
---------
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
gh-49174: document that the effect of calling gc.collect() during a collection is undefined (GH-104699)
(cherry picked from commit 30488fa22a)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Add a mention of PYTHONBREAKPOINT to breakpoint() docs (GH-104430)
(cherry picked from commit 1be80ed107)
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
* separate documentation and examples for both functions
* add examples demonstrating behaviour with unsupported types
* document return value of `get_origin` for `ParamSpecArgs` and `ParamSpecKwargs` instances
(cherry picked from commit a7a2dbbf72)
Co-authored-by: chgnrdv <52372310+chgnrdv@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
gh-102327: Extend docs for "url" and "headers" parameters to HTTPConnection.request()
Added example on how to use the HTTPConnection object for making GET request.
Original issue: https://github.com/python/cpython/issues/102327
---------
(cherry picked from commit 7ba6288feb)
Co-authored-by: David Foster <david@dafoster.net>
Co-authored-by: Éric <earaujo@caravan.coop>
GH-104145: Use fully-qualified cross reference types for the bisect module (GH-104172)
(cherry picked from commit 76eef552f3)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
gh-102500: Remove mention of bytes shorthand (#104281)
The bytes shorthand was removed in PEP 688:
https://peps.python.org/pep-0688/#no-special-meaning-for-bytes
The reference to collections.abc.ByteString is also removed, since that object is deprecated (#91896) and has different semantics (#102092)
Although PEP 688 is new in Python 3.12, type checkers are expected to implement the new semantics for type annotations even if users are using an older version of Python, so this docs PR is backported to Python 3.11.
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
gh-104254: Document the optional keyword-only "context" argument to Task constructor (GH-104251)
(This was added in 3.11. It was already documented for `create_task()`, but not for `Task()`.)
(cherry picked from commit 4ee2068c34)
Co-authored-by: Itamar Ostricher <itamarost@gmail.com>
GH-97950: Use new-style index directive ('builtin') (GH-104164)
* Uncomment builtin removal in pairindextypes
* Use new-style index directive ('builtin') - C API
* Use new-style index directive ('builtin') - Extending
* Use new-style index directive ('builtin') - Library
* Use new-style index directive ('builtin') - Reference
* Use new-style index directive ('builtin') - Tutorial
(cherry picked from commit f5088006ca)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
gh-104112: link from cached_property docs to method-caching FAQ (GH-104113)
(cherry picked from commit fa86a77589)
Co-authored-by: Carl Meyer <carl@oddbird.net>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
GH-97950: Use new-style index directive ('object') (GH-104158)
* Uncomment object removal in pairindextypes
* Use new-style index directive ('object') - C API
* Use new-style index directive ('object') - Library
* Use new-style index directive ('object') - Reference
* Use new-style index directive ('object') - Tutorial
(cherry picked from commit 6ab463684b)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Improve assert_type phrasing (GH-104081)
I'd like to make the fact that this does nothing at runtime
really obvious, since I suspect this is unintuitive for users who are
unfamiliar with static type checking.
I thought of this because of
https://discuss.python.org/t/add-arg-check-type-to-types/26384
wherein I'm skeptical that the user really did want `assert_type`.
(cherry picked from commit 82ba6ce303)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
This removes a section of the `strftime` and `strptime` documentation that refers to a bygone era when `strftime` would return an encoded byte string.
---------
(cherry picked from commit 2aa22f72fb)
Co-authored-by: William Andrea <william.j.andrea@gmail.com>
Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Clarify that asyncio.Server.sockets is a socket-like TransportSocket
(cherry picked from commit 1c0a9c5a1c)
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Cc. @adriangb
The "stub documentation" in `types.rst` does already link to the
in-depth docs in `stdtypes.rst`, but the link isn't obvious for new
users. It deserves to be made more prominent.
- Issue: https://github.com/python/cpython/issues/103721
(cherry picked from commit cef542ca57)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
modernize dataclass example typing `list` rather than `List` and comment
as to that line being the alluded too error.
(cherry picked from commit 7ef614c1ad)
Co-authored-by: Allan Lago <35788148+alago1@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Clarifies that it remains None until a method checking the child process
status has been called and noticed it has terminated.
(cherry picked from commit 68f5836582)
Co-authored-by: Joshua Herman <30265+zitterbewegung@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
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>
Fix broken links reported by linkcheck (#103608)
gh-68654: Clarify subdirectories used by pkgutil.extend_path (GH-103701)
Clarify sub directories used by pkgutil.extend_path in the docs and the docstring
(cherry picked from commit 7bf94568a9)
Co-authored-by: Randy <69558016+san-juan1667@users.noreply.github.com>
GH-103475: cache() and lru_cache() do not have a "call once" guarantee (GH-103669)
(cherry picked from commit e5eaac6064)
Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
STRICT boundary:
- fix bitwise operations
- make default for Flag
(cherry picked from commit 2194071540)
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Also use `raise TimeOut from <CancelledError instance>` so that the CancelledError is set
in the `__cause__` field rather than in the `__context__` field.
(cherry picked from commit 04adf2df39)
Co-authored-by: Kristján Valur Jónsson <sweskman@gmail.com>
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Fix outdated note about 'int' rounding or truncating (GH-102736)
(cherry picked from commit 405739f916)
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
gh-102354: change python3 to python in docs examples (GH-102696)
(cherry picked from commit 80abd62647)
Co-authored-by: Paul Watson <paul.hermeneutic@gmail.com>
* Replace known bad address pointing toward a malicious web page.
(cherry picked from commit 61479d4684)
Co-authored-by: Blind4Basics <32236948+Blind4Basics@users.noreply.github.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
(cherry picked from commit 78e4e6c3d7)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Fixes duplicated word (GH-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").
(cherry picked from commit e6210621be)
Co-authored-by: Guido van Rossum <guido@python.org>
Co-authored-by: Hugo Gabriel Eyherabide <hugogabriel.eyherabide@gmail.com>
Move around example in to_bytes() to avoid confusion (GH-101595)
Moves an example to be closer to the sentence that refers to it.
(cherry picked from commit 5da379ca7d)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
[3.11] 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
Co-authored-by: Michael K <michael-k@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Brad Wolfe <brad.wolfe@gmail.com>
Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
Fix erroneous doc links in the sys module (#101319)
gh-85417: Clarify behaviour on branch cuts in cmath module (GH-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
(cherry picked from commit b513c46d99)
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
(cherry picked from commit b7c1126447)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
(cherry picked from commit b40dd71241)
Co-authored-by: ram vikram singh <ramvikrams243@gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Adjust wording slightly, and use min(entries) instead of
sorted(list(entries))[0] as an example.
(cherry picked from commit 350ba7c07f)
Co-authored-by: Owain Davies <116417456+OTheDev@users.noreply.github.com>
Note: the `timeout` parameter was not added until 3.12.
(cherry picked from commit c4de6b1d52)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>.
Co-authored-by: Brian Skinn <brian.skinn@gmail.com>
* 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.
(cherry picked from commit 924a3bfa28)
Co-authored-by: sblondon <stephane.blondon@gmail.com>
gh-101390: Fix docs for `imporlib.util.LazyLoader.factory` to properly call it a class method (GH-101391)
(cherry picked from commit 17143e2c30)
Co-authored-by: busywhitespace <busywhitespace@tuta.io>
(cherry picked from commit 2037ebf81b)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* 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.
(cherry picked from commit 027adf42cd)
Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>