Commit Graph

26577 Commits

Author SHA1 Message Date
chgnrdv a7a2dbbf72
gh-104010: Separate and improve docs for `typing.get_origin` and `typing.get_args` (#104013)
* 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

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-05-10 07:48:55 -07:00
Hugo van Kemenade 13ac1766bc
gh-103960: Dark mode: invert image brightness (#103983) 2023-05-10 16:46:37 +03:00
David Foster 7ba6288feb
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

---------

Co-authored-by: Éric <earaujo@caravan.coop>
2023-05-09 12:57:17 -07:00
Jacob Bower 2866e030f0
gh-97696 Add documentation for get_coro() behavior with eager tasks (#104304) 2023-05-09 10:09:16 -07:00
Carl Meyer c3b595e73e
gh-97933: (PEP 709) inline list/dict/set comprehensions (#101441)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-05-09 11:02:14 -06:00
Itamar Ostricher 85f981880a
gh-97696: Move around and update the whatsnew entry for asyncio eager task factory (#104298) 2023-05-09 12:39:59 +00:00
Zhang Na 03029ace92
gh-90656: Add platform triplets for 64-bit LoongArch (LA64) (#30939)
Signed-off-by: Zhang Na <zhangna@loongson.cn>
Co-authored-by: WANG Xuerui <git@xen0n.name>
2023-05-09 09:19:40 +00:00
Adam Turner 942482c8e6
GH-104284: Fix documentation gettext build (#104296) 2023-05-08 19:01:25 +00:00
Adam Turner 76eef552f3
GH-104145: Use fully-qualified cross reference types for the bisect module (#104172) 2023-05-08 17:32:18 +01:00
Shantanu 1f5679540c
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

I also remove the reference to `collections.abc.ByteString`, since that
object is deprecated (#91896) and has different semantics (#102092)
2023-05-08 14:40:51 +01:00
Itamar Ostricher c2683fc46d
gh-97696: Improve and fix documentation for asyncio eager tasks (#104256) 2023-05-08 17:29:34 +05:30
Alex Waygood 1b19bd1a88
gh-103193: cache calls to `inspect._shadowed_dict` in `inspect.getattr_static` (#104267)
Co-authored-by: Carl Meyer <carl@oddbird.net>
2023-05-07 18:45:09 +01:00
Itamar Ostricher 4ee2068c34
gh-104254: Document the optional keyword-only "context" argument to Task constructor (#104251)
(This was added in 3.11. It was already documented for `create_task()`, but not for `Task()`.)
2023-05-06 18:31:53 -07:00
Alex Waygood 376137f6ec
gh-90953: Emit deprecation warnings for `ast` features deprecated in Python 3.8 (#104199)
`ast.Num`, `ast.Str`, `ast.Bytes`, `ast.Ellipsis` and `ast.NameConstant` now all emit deprecation warnings on import, access, instantation or `isinstance()` checks.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-05-06 16:48:07 +00:00
Adam Turner f5088006ca
GH-97950: Use new-style index directive ('builtin') (#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
2023-05-06 06:54:08 +03:00
Sam Morris 4cd95dce0b
gh-102215: importlib documentation cleanups 2023-05-06 03:40:19 +01:00
Barney Gale d00d942149
GH-100479: Add `pathlib.PurePath.with_segments()` (GH-103975)
Add `pathlib.PurePath.with_segments()`, which creates a path object from arguments. This method is called whenever a derivative path is created, such as from `pathlib.PurePath.parent`. Subclasses may override this method to share information between path objects.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-05-05 19:04:53 +00:00
Erlend E. Aasland 721a78395d
gh-64658: Expand Argument Clinic return converter docs (#104175) 2023-05-05 13:32:00 +02:00
Carl Meyer fa86a77589
gh-104112: link from cached_property docs to method-caching FAQ (#104113)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2023-05-04 16:38:53 -06:00
Hugo van Kemenade d47cddfa27
gh-102500: Add PEP 688 and 698 to the 3.12 release highlights (#104174) 2023-05-04 19:55:48 +03:00
Barney Gale 8100be5535
GH-81079: Add case_sensitive argument to `pathlib.Path.glob()` (GH-102710)
This argument allows case-sensitive matching to be enabled on Windows, and
case-insensitive matching to be enabled on Posix.

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2023-05-04 16:44:36 +00:00
Shantanu 09b7695f12
gh-91896: Deprecate collections.abc.ByteString (#102096)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-05-04 09:39:33 -07:00
Jelle Zijlstra b7a0a52196
gh-102500: Document PEP 688 (#102571)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2023-05-04 08:23:40 -07:00
Gleb Smirnoff b17d32c114
gh-96534: socketmodule: support FreeBSD divert(4) socket (#96536) 2023-05-04 14:57:05 +00:00
Adam Turner 55d50d147c
GH-97950: Use new-style index directive ('statement') (#104162) 2023-05-04 13:48:45 +03:00
Adam Turner 3e7995ca11
GH-97950: Use new-style index directive ('exception') (#104160) 2023-05-04 13:30:24 +03:00
Adam Turner 6ab463684b
GH-97950: Use new-style index directive ('object') (#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
2023-05-04 13:04:41 +03:00
Adam Turner b0ce2db118
GH-97950: Use new-style index directive ('operator') (#104156) 2023-05-04 12:03:11 +03:00
Adam Turner 33ca322c50
GH-97950: Use new-style index directive ('keyword') (#104153)
* Uncomment keyword removal in pairindextypes

* Use new-style index directive ('keyword') - Reference
2023-05-04 10:44:12 +02:00
Adam Turner d0122372f2
GH-97950: Use new-style index directive ('module') (#103996)
* Use new-style index directive ('module') - C API

* Use new-style index directive ('module') - Library

* Use new-style index directive ('module') - Reference

* Use new-style index directive ('module') - Tutorial

* Uncomment module removal in pairindextypes

* Use new-style index directive ('module') - C API

* Use new-style index directive ('module') - Library

* Use new-style index directive ('module') - Reference
2023-05-04 10:17:12 +02:00
Petr Viktorin cd9a56c2b0
gh-103509: PEP 697 -- Limited C API for Extending Opaque Types (GH-103511)
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-05-04 09:56:53 +02:00
Adam Turner 35d273825a
GH-97950: Allow translation of index directive content (#104000) 2023-05-04 10:11:09 +03:00
Nikita Sobolev d6e83fbf30
gh-97850: Deprecate `find_loader` and `get_loader` in `pkgutil` (GH-98520)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2023-05-03 16:11:54 -07:00
Irit Katriel 9f9e001ab2
gh-103590: mention that the change is included in 3.11.4 and clarify except* documentation (#104095) 2023-05-03 21:55:19 +01:00
Tian Gao 0fc58c66ba
gh-103693: Add convenience variable feature to `pdb` (#103694) 2023-05-03 15:04:50 +01:00
Petr Viktorin 524a7f77fd
gh-103968: Deprecate creating heap types whose metaclass has custom tp_new. (GH-103972)
(That's a mouthful of an edge case!)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
2023-05-03 15:17:14 +02:00
Adam Turner 423d7faeb3
GH-97850: Suppress cross-references to removed ``importlib.util`` functions (#104134)
`importlib.utils` -> `importlib.util` in a few places

---------

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-05-03 14:13:03 +01:00
Adam Turner 8b03e5ff94
GH-97850: Suppress cross-references to the removed ``module_repr`` method (#104133)
Suppress cross-references to ``module_repr``
2023-05-03 13:57:23 +01:00
Adam Turner 328435ed42
GH-98040: Suppress cross-references to the removed ``imp`` module (#104131)
Suppress cross-references to imp
2023-05-03 13:29:42 +01:00
Barry Warsaw 326997829d
gh-98040: Remove find_loader, find_module and other deprecated APIs (#98059)
* Remove deprecated classes from pkgutil
* Remove some other PEP 302 obsolescence
* Use find_spec instead of load_module
* Remove more tests of PEP 302 obsolete APIs
* Remove another bunch of tests using obsolete load_modules()
* Remove deleted names from __all__
* Remove obsolete footnote
* imp is removed
* Remove `imp` from generated stdlib names
* What's new and blurb
* Update zipimport documentation for the removed methods
* Fix some Windows tests
* Remove any test (or part of a test) that references `find_module()`.
* Use assertIsNone() / assertIsNotNone() consistently.
* Update Doc/reference/import.rst
* We don't need pkgutil._get_spec() any more either
*  test.test_importlib.fixtures.NullFinder
* ...BadLoaderFinder.find_module
* ...test_api.InvalidatingNullFinder.find_module
* ...test.test_zipimport test of z.find_module
* Suppress cross-references to find_loader and find_module
* Suppress cross-references to Finder
* Suppress cross-references to pkgutil.ImpImporter and pkgutil.ImpLoader

---------

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2023-05-03 04:55:22 -07:00
Tim Hoffmann fdb3ef8c0f
gh-82012: Deprecate bitwise inversion (~) of bool (#103487)
The bitwise inversion operator on bool returns the bitwise inversion of the
underlying int value; i.e. `~True == -2` such that `bool(~True) == True`.

It's a common pitfall that users mistake `~` as negation operator and actually
want `not`. Supporting `~` is an artifact of bool inheriting from int. Since there
is no real use-case for the current behavior, let's deprecate `~` on bool and
later raise an error. This removes a potential source errors for users.

Full reasoning: https://github.com/python/cpython/issues/82012#issuecomment-1258705971

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2023-05-03 00:00:42 -07:00
Hugo van Kemenade 5b05b013ff
gh-101100: Fix Sphinx warnings in `curses` and `curses.ascii` modules (#103457)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2023-05-02 23:09:04 -06:00
andrei kulakov af886ffa06
GH-89769: `pathlib.Path.glob()`: do not follow symlinks when checking for precise match (GH-29655)
Co-authored-by: Barney Gale <barney.gale@gmail.com>
2023-05-03 04:50:10 +01:00
Shantanu 587f2f0180
gh-65022: Fix description of tuple return value in copyreg (#103892) 2023-05-02 11:13:47 -07:00
Jurica Bradarić 87223f32ab
gh-103743: Add PyUnstable_Object_GC_NewWithExtraData (GH-103744)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-05-02 13:38:46 +02:00
Rafael Fontenelle 68ed2a2a3f
GH-103484: Fix redirected permanently URLs (#104001)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
2023-05-02 09:34:44 +03:00
Shantanu 82ba6ce303
Improve assert_type phrasing (#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`.
2023-05-01 23:05:25 -07:00
Itamar Ostricher a474e04388
gh-97696: asyncio eager tasks factory (#102853)
Co-authored-by: Jacob Bower <jbower@meta.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2023-05-01 15:10:13 -06:00
Anže Pečar e665563f83
gh-100458: Clarify Enum.__format__() change of mixed-in types in the whatsnew/3.11.rst (GH-100387)
Co-authored-by: JosephSBoyle <48555120+JosephSBoyle@users.noreply.github.com>
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2023-05-01 12:49:54 -07:00
Ben Faulhaber 93107aa2a4
Adjust expression from `==` to `!=` in alignment with the meaning of the paragraph. (GH-104021) 2023-05-01 06:47:34 +01:00