]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
4 years agoUpdate URLs in comments and metadata to use HTTPS (GH-27458) (GH-27478)
Miss Islington (bot) [Fri, 30 Jul 2021 14:25:28 +0000 (07:25 -0700)] 
Update URLs in comments and metadata to use HTTPS (GH-27458) (GH-27478)

(cherry picked from commit be42c06bb01206209430f3ac08b72643dc7cad1c)

Co-authored-by: Noah Kantrowitz <noah@coderanger.net>
4 years agoDoc: Change errant 3.10.0 to 3.10, to match other mentions (GH-27459) (GH-27479)
Miss Islington (bot) [Fri, 30 Jul 2021 14:16:46 +0000 (07:16 -0700)] 
Doc: Change errant 3.10.0 to 3.10, to match other mentions (GH-27459) (GH-27479)

(cherry picked from commit f4367ba3c533fc2dc9e32aa431d674f715b911f2)

Co-authored-by: Ori Avtalion <ori@avtalion.name>
4 years agobpo-44761: Change default value of NewType __module__ attr (GH-27406) (GH-27477)
Miss Islington (bot) [Fri, 30 Jul 2021 13:48:01 +0000 (06:48 -0700)] 
bpo-44761: Change default value of NewType __module__ attr (GH-27406) (GH-27477)

(cherry picked from commit 7b975f81e4dba70a42c6279539a7fcfe4211b4c0)

Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
4 years ago[3.10] bpo-31746: Prevent segfaults when sqlite3.Connection is uninitialised (GH...
Erlend Egeberg Aasland [Fri, 30 Jul 2021 12:01:22 +0000 (14:01 +0200)] 
[3.10] bpo-31746: Prevent segfaults when sqlite3.Connection is uninitialised (GH-27431). (GH-27472)

(cherry picked from commit 7e311e496b0e26b3d3c62fe9b0ed2a4677c37ee9)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
4 years agobpo-44662: Add ability to annotate types.Union (GH-27214) (GH-27461)
Miss Islington (bot) [Fri, 30 Jul 2021 09:31:54 +0000 (02:31 -0700)] 
bpo-44662: Add ability to annotate types.Union (GH-27214) (GH-27461)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
(cherry picked from commit 8182c8329c709f42218a8a17d81639ece5b7b627)

Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
4 years agobpo-44479: Do not regenerate files during a PGO build as it will invalidate the profi...
Steve Dower [Thu, 29 Jul 2021 22:18:17 +0000 (23:18 +0100)] 
bpo-44479: Do not regenerate files during a PGO build as it will invalidate the profile. (GH-27462)

Also remove some unused code that should not have been backported.

4 years agoAdd missing gdbm dependencies to the UNIX CI (GH-27467)
Miss Islington (bot) [Thu, 29 Jul 2021 22:01:07 +0000 (15:01 -0700)] 
Add missing gdbm dependencies to the UNIX CI (GH-27467)

(cherry picked from commit 851cca8c22795a2f143ad5ebc10adab3c7784ad0)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
4 years agoFix typo in ast.rst (GH-27449) (GH-27454)
Miss Islington (bot) [Thu, 29 Jul 2021 17:38:28 +0000 (10:38 -0700)] 
Fix typo in ast.rst (GH-27449) (GH-27454)

Co-authored-by: HaeckelK <haeckelk.github@gmail.com>
(cherry picked from commit 6b61d74a3bab43a44fa47b1facd1bec3d74e12b1)

Co-authored-by: HaeckelK <51128712+HaeckelK@users.noreply.github.com>
4 years agoTo fix the random failed test cases of test___xxsubinterpreters in multiprocess....
Miss Islington (bot) [Thu, 29 Jul 2021 17:27:24 +0000 (10:27 -0700)] 
To fix the random failed test cases of test___xxsubinterpreters in multiprocess. (GH-27240) (GH-27452)

(cherry picked from commit 9101b39e67c2437e88c0ad6b57aafd48ab08d431)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
4 years agobpo-44765: [doc] fix typo (GH-27430) (GH-27450)
Miss Islington (bot) [Thu, 29 Jul 2021 17:22:57 +0000 (10:22 -0700)] 
bpo-44765: [doc] fix typo (GH-27430) (GH-27450)

(cherry picked from commit ccefa8a905c797e4a60078d5e1de846f929c6928)

Co-authored-by: Pavel <69010336+pavel-lexyr@users.noreply.github.com>
4 years agobpo-44752: refactor part of rlcompleter.Completer.attr_matches (GH-27433) (GH-27447)
Miss Islington (bot) [Thu, 29 Jul 2021 15:44:42 +0000 (08:44 -0700)] 
bpo-44752: refactor part of rlcompleter.Completer.attr_matches (GH-27433) (GH-27447)

(cherry picked from commit 6741794dd420c6b9775a188690dbf265037cd69f)

Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
4 years agobpo-32280: Store _PyRuntime in a named section (GH-4802) (#27448)
Miss Islington (bot) [Thu, 29 Jul 2021 15:20:58 +0000 (08:20 -0700)] 
bpo-32280: Store _PyRuntime in a named section (GH-4802) (#27448)

This commit stores the _PyRuntime structure in a section of the same name. This allows a debugging or crash reporting tool to quickly locate this structure at runtime without requiring the symbol table.

Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
(cherry picked from commit 35002aa8f62dda1f79035e9904abdf476683e9be)

Co-authored-by: Max Bélanger <aeromax@gmail.com>
Co-authored-by: Max Bélanger <aeromax@gmail.com>
4 years agobpo-44752: Make rlcompleter not call `@property` methods (GH-27401) (GH-27444)
Miss Islington (bot) [Thu, 29 Jul 2021 12:07:00 +0000 (05:07 -0700)] 
bpo-44752: Make rlcompleter not call `@property` methods (GH-27401) (GH-27444)

* rlcompleter was calling these methods to identify whether to add
  parenthesis to the completion, based on if the attribute is callable.
* for property objects, completion with parenthesis are never desirable.
* property methods with print statements behaved very strangely, which
  was especially unfriendly to language newcomers. <tab> could suddenly
  produce output unexpectedly.
(cherry picked from commit 50de8f74f8e92b20e76438c22b6a8f91afd6df75)

Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
4 years agobpo-44707: Fix an undefined behavior of the null pointer arithmetic (GH-27292) (GH...
Miss Islington (bot) [Thu, 29 Jul 2021 12:05:30 +0000 (05:05 -0700)] 
bpo-44707: Fix an undefined behavior of the null pointer arithmetic (GH-27292) (GH-27442)

(cherry picked from commit e5c8ddb1714fb51ab1defa24352c98e0f01205dc)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
4 years agobpo-41103: Resurrect the old buffer protocol. (GH-27437) (GH-27441)
Miss Islington (bot) [Thu, 29 Jul 2021 11:31:42 +0000 (04:31 -0700)] 
bpo-41103: Resurrect the old buffer protocol. (GH-27437) (GH-27441)

Revert "bpo-41103: Remove old buffer protocol support (GH-21117)"

This reverts commit 6f8a6ee59cb7f99f68df8ee9c3e8c8cf19af3eed.
(cherry picked from commit ce5e1a6809b714eb0383219190a076d9f883e008)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
4 years agobpo-43565: Document PyUnicode_KIND's return type as an unsigned int (GH-25724) (GH...
Miss Islington (bot) [Thu, 29 Jul 2021 09:31:02 +0000 (02:31 -0700)] 
bpo-43565: Document PyUnicode_KIND's return type as an unsigned int (GH-25724) (GH-27439)

(cherry picked from commit 47fd4726a2ce8599cc397ddeae40f70eb471e868)

Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
4 years ago[3.10] bpo-43897: Reject "_" captures and top-level MatchStar in the AST validator...
Miss Islington (bot) [Thu, 29 Jul 2021 01:02:14 +0000 (18:02 -0700)] 
[3.10] bpo-43897: Reject "_" captures and top-level MatchStar in the AST validator (GH-27432) (GH-27435)

(cherry picked from commit 8d0647485db5af2a0f0929d6509479ca45f1281b)

Co-authored-by: Brandt Bucher <brandt@python.org>
Automerge-Triggered-By: GH:brandtbucher
4 years agobpo-40263: Fixes an off-by-one error in _winapi_WaitForMultipleObjects_impl (GH-19501)
Miss Islington (bot) [Wed, 28 Jul 2021 20:18:01 +0000 (13:18 -0700)] 
bpo-40263: Fixes an off-by-one error in _winapi_WaitForMultipleObjects_impl (GH-19501)

(cherry picked from commit 92b5dc780db968f6277f42cb06926dddb7475dc6)

Co-authored-by: Ray Donnelly <mingw.android@gmail.com>
4 years agobpo-44763: [doc] remove repetitive sentence from textwrap.wrap (GH-27423) (GH-27426)
Miss Islington (bot) [Wed, 28 Jul 2021 17:30:58 +0000 (10:30 -0700)] 
bpo-44763: [doc] remove repetitive sentence from textwrap.wrap (GH-27423) (GH-27426)

(cherry picked from commit cb1d76f10ab33dddd0dbd64e6506bf7c065d499b)

Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
4 years agobpo-44544: [doc] list all textwrap func kwargs (GH-26999) (GH-27424)
Miss Islington (bot) [Wed, 28 Jul 2021 17:29:25 +0000 (10:29 -0700)] 
bpo-44544: [doc] list all textwrap func kwargs (GH-26999) (GH-27424)

(cherry picked from commit c1e39d6b1167376fdaf3f288ba9a689e61c7fdd1)

Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
4 years agobpo-27827: identify a greater range of reserved filename on Windows. (GH-26698) ...
Miss Islington (bot) [Wed, 28 Jul 2021 15:01:47 +0000 (08:01 -0700)] 
bpo-27827: identify a greater range of reserved filename on Windows. (GH-26698) (GH-27421)

`pathlib.PureWindowsPath.is_reserved()` now identifies as reserved
filenames with trailing spaces or colons.

Co-authored-by: Barney Gale <barney.gale@foundry.com>
Co-authored-by: Eryk Sun <eryksun@gmail.com>
(cherry picked from commit 56c1f6d7edad454f382d3ecb8cdcff24ac898a50)

4 years agoFix typo in sqlite3.rst (GH-27415) (GH-27417)
Miss Islington (bot) [Wed, 28 Jul 2021 14:33:26 +0000 (07:33 -0700)] 
Fix typo in sqlite3.rst (GH-27415) (GH-27417)

preceeding -> preceding
(cherry picked from commit fbe87023bf33e941373a5fca023652a825db7baf)

Co-authored-by: Ikko Ashimine <eltociear@gmail.com>
4 years agoAdd missing end of sentence in docs (GH-27280) (GH-27419)
Miss Islington (bot) [Wed, 28 Jul 2021 14:32:38 +0000 (07:32 -0700)] 
Add missing end of sentence in docs (GH-27280) (GH-27419)

(cherry picked from commit 531e2fbc52ce07a9cf37e0db05a5337e404dfccd)

Co-authored-by: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com>
4 years agoChange type check to isinstance in pipes (GH-27291) (GH-27416)
Miss Islington (bot) [Wed, 28 Jul 2021 14:08:51 +0000 (07:08 -0700)] 
Change type check to isinstance in pipes (GH-27291) (GH-27416)

(cherry picked from commit 9ffbb899462b819864f777d0228fb8f1bb89b018)

Co-authored-by: Anton Grübel <anton.gruebel@gmail.com>
4 years agoSpell out 's.pop() or s.pop(i)' (GH-27398) (GH-27412)
Miss Islington (bot) [Wed, 28 Jul 2021 13:56:17 +0000 (06:56 -0700)] 
Spell out 's.pop() or s.pop(i)' (GH-27398) (GH-27412)

(cherry picked from commit 2ff5bb4908975976031ba738866de619cafadc4d)

Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
4 years agobpo-44756: in ./Doc, `make build` depends on `make html` (GH-27403) (GH-27410)
Miss Islington (bot) [Wed, 28 Jul 2021 13:35:18 +0000 (06:35 -0700)] 
bpo-44756: in ./Doc, `make build` depends on `make html` (GH-27403) (GH-27410)

- venv rule is now conditional, and only does anything if $VENVDIR does not exist
- add rule "clean-venv"
(cherry picked from commit d22c876d5ac5fa464337d2e82654b8d87a83cb1b)

Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
4 years agobpo-44657: Fix instancemethod_call to use PyInstanceMethod_GET_FUNCTION (GH-27202)
Miss Islington (bot) [Wed, 28 Jul 2021 13:29:17 +0000 (06:29 -0700)] 
bpo-44657: Fix instancemethod_call to use PyInstanceMethod_GET_FUNCTION (GH-27202)

(cherry picked from commit ddf8ae31a0f371eff2db14c7f7a45976b86d56ea)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
4 years ago[3.10] bpo-44461: Check early that a pdb target is valid for execution. (GH-27227...
Jason R. Coombs [Wed, 28 Jul 2021 13:04:38 +0000 (09:04 -0400)] 
[3.10] bpo-44461: Check early that a pdb target is valid for execution. (GH-27227) (GH-27399)

Automerge-Triggered-By: GH:jaraco
4 years agobpo-44600: Refactor new tracing tests (GH-27396) (GH-27404)
Miss Islington (bot) [Wed, 28 Jul 2021 12:38:39 +0000 (05:38 -0700)] 
bpo-44600: Refactor new tracing tests (GH-27396) (GH-27404)

(cherry picked from commit 38ddc8beb38d9a685de296a58b0741850e4853e5)

Co-authored-by: Brandt Bucher <brandt@python.org>
4 years agobpo-34013: Move the Python 2 hints from the exception constructor to the parser ...
Miss Islington (bot) [Tue, 27 Jul 2021 21:19:18 +0000 (14:19 -0700)] 
bpo-34013: Move the Python 2 hints from the exception constructor to the parser (GH-27392)

(cherry picked from commit ecc3c8e4216958d85385bf2467441c975128f26c)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
4 years ago[3.10] bpo-34013: Generalize the invalid legacy statement error message (GH-27389...
Pablo Galindo Salgado [Tue, 27 Jul 2021 17:52:32 +0000 (18:52 +0100)] 
[3.10] bpo-34013: Generalize the invalid legacy statement error message (GH-27389). (GH-27391)

(cherry picked from commit 6948964ecf94e858448dd28eea634317226d2913)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
4 years agobpo-44740: Make minor edits to lowercasing "internet" and "web". (GH-27385) (#27386)
Miss Islington (bot) [Tue, 27 Jul 2021 09:20:11 +0000 (02:20 -0700)] 
bpo-44740: Make minor edits to lowercasing "internet" and "web". (GH-27385) (#27386)

Follow up to 11749e2dc20ad6a76e9a39e948853e89b2b4bbed
(cherry picked from commit 2e41df4d60d71a2551b9605d07321f75cfb52adf)

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
4 years ago[doc] Fix typo in asyncio Event Loop (GH-27377)
Miss Islington (bot) [Tue, 27 Jul 2021 04:07:30 +0000 (21:07 -0700)] 
[doc] Fix typo in asyncio Event Loop (GH-27377)

First Pull Request to cpython, so forgive me for any mistakes

Automerge-Triggered-By: GH:Mariatta
(cherry picked from commit 6fa4060b86a116dc4fb69356795faf6ff1cdde58)

Co-authored-by: Vinicius Gubiani Ferreira <vini.g.fer@gmail.com>
4 years agoAdd windows build.bat counterpart for 'make regen-all' in error message (GH-26770)
Miss Islington (bot) [Tue, 27 Jul 2021 03:27:48 +0000 (20:27 -0700)] 
Add windows build.bat counterpart for 'make regen-all' in error message (GH-26770)

(cherry picked from commit d61b69f02d441ae517109a4428f2a18416c9ff0f)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
4 years agobpo-44740: Lowercase "internet" and "web" where appropriate. (GH-27378) (GH-27380)
Miss Islington (bot) [Mon, 26 Jul 2021 22:34:32 +0000 (15:34 -0700)] 
bpo-44740: Lowercase "internet" and "web" where appropriate. (GH-27378) (GH-27380)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 11749e2dc20ad6a76e9a39e948853e89b2b4bbed)

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
4 years agobpo-44515: handle non-refcounted GC in contextlib tests (GH-26910) (GH-27379)
Miss Islington (bot) [Mon, 26 Jul 2021 21:21:36 +0000 (14:21 -0700)] 
bpo-44515: handle non-refcounted GC in contextlib tests (GH-26910) (GH-27379)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit a2c45e5bcf9d3dfff9f2699dbc161489897616b5)

Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
4 years agodocs: replace "Mac OS X" -> "macOS" (GH-27364) (GH-27374)
Miss Islington (bot) [Mon, 26 Jul 2021 20:22:26 +0000 (13:22 -0700)] 
docs: replace "Mac OS X" -> "macOS" (GH-27364) (GH-27374)

"Mac OS X" has been rebranded as macOS

https://www.apple.com/macos
(cherry picked from commit 5fdd2a14ce3f81a7db47bb79421c426dec4b25bd)

Co-authored-by: partev <petrosyan@gmail.com>
4 years agoThe current documentation says it returns None if the name is not found, but (GH...
Miss Islington (bot) [Mon, 26 Jul 2021 19:35:33 +0000 (12:35 -0700)] 
The current documentation says it returns None if the name is not found, but (GH-26785) (GH-27371)

the implementation uses [] and will raise KeyError instead.

Noticed by @srittau in python/typeshed@5659.
(cherry picked from commit f22737abfa07605f4ed1a99cfa97a26520b6c5c2)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
4 years agobpo-43443: Clarify difference between shelve objects and dicts (GH-27004) (GH-27369)
Miss Islington (bot) [Mon, 26 Jul 2021 19:32:36 +0000 (12:32 -0700)] 
bpo-43443: Clarify difference between shelve objects and dicts (GH-27004) (GH-27369)

(cherry picked from commit c97c2a050cf753003012ae3f08e035326b8f6167)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
4 years agobpo-44490: Add 'Whats New' docs regarding types.Union changes (GH-27215) (GH-27368)
Miss Islington (bot) [Mon, 26 Jul 2021 19:32:05 +0000 (12:32 -0700)] 
bpo-44490: Add 'Whats New' docs regarding types.Union changes (GH-27215) (GH-27368)

(cherry picked from commit 6c1b57d958e2b0d5bcf0f2315b5044838e11638f)

Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
4 years agobpo-44698: Fix undefined behaviour in complex exponentiation. (GH-27278) (#27366)
Miss Islington (bot) [Mon, 26 Jul 2021 19:29:52 +0000 (12:29 -0700)] 
bpo-44698: Fix undefined behaviour in complex exponentiation. (GH-27278) (#27366)

(cherry picked from commit 1d582bbc969e05896addf97844ddf17ce9830e5e)

Co-authored-by: T. Wouters <thomas@python.org>
4 years agobpo-44732: Rename types.Union to types.UnionType (GH-27342)
Miss Islington (bot) [Mon, 26 Jul 2021 19:02:58 +0000 (12:02 -0700)] 
bpo-44732: Rename types.Union to types.UnionType (GH-27342)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit 2b8ad9e6c5f0a66e9ca2d15f85336d8a3eefefb0)

Co-authored-by: Hasan <hasan.aleeyev@gmail.com>
4 years agobpo-44734: Fix precision in turtle tests (GH-27343) (GH-27361)
Miss Islington (bot) [Mon, 26 Jul 2021 15:55:50 +0000 (08:55 -0700)] 
bpo-44734: Fix precision in turtle tests (GH-27343) (GH-27361)

(cherry picked from commit 3f135c073a53793ec68902f6b513934ddff47235)

Co-authored-by: Logan Jones <loganasherjones@gmail.com>
4 years agobpo-44693: Update __future__ entry in Doc/glossary.rst (GH-27349) (GH-27357)
Miss Islington (bot) [Mon, 26 Jul 2021 01:40:08 +0000 (18:40 -0700)] 
bpo-44693: Update __future__ entry in Doc/glossary.rst (GH-27349) (GH-27357)

Replace sentence with confusing "pseudo-module" with two sentences
separating future statements and the __future__ module.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit 0363a4014d90df17a29042de008ef0b659f92505)

Co-authored-by: Steven Hsu <hsuhaochun@gmail.com>
Co-authored-by: Steven Hsu <hsuhaochun@gmail.com>
4 years ago[3.10] bpo-44600: Fix line numbers for pattern matching cleanup code (GH-27346) ...
Miss Islington (bot) [Mon, 26 Jul 2021 00:04:06 +0000 (17:04 -0700)] 
[3.10] bpo-44600: Fix line numbers for pattern matching cleanup code (GH-27346) (GH-27356)

(cherry picked from commit 4214f470f0cb9b6fef9a90758756fbc00ba95b5a)

Co-authored-by: Charles Burkland <charles.aburkland@gmail.com>
Automerge-Triggered-By: GH:brandtbucher
4 years ago[3.10] bpo-44399: Update logging cookbook to document patterns to be avoided. (GH...
Miss Islington (bot) [Sun, 25 Jul 2021 19:31:54 +0000 (12:31 -0700)] 
[3.10] bpo-44399: Update logging cookbook to document patterns to be avoided. (GH-27348) (GH-27352)

(cherry picked from commit 9751f85914e0ef3324671a91da34a635d48b17fb)

4 years ago[3.10] bpo-43184: Add information about added attribute and method. (GH-27347) (GH...
Miss Islington (bot) [Sun, 25 Jul 2021 19:30:50 +0000 (12:30 -0700)] 
[3.10] bpo-43184: Add information about added attribute and method. (GH-27347) (GH-27355)

(cherry picked from commit 50b72768ffe6413424dc4eba916dd1ff89a2fe7b)

4 years agobpo-44676: Serialize the union type using only public API (GH-27323) (GH-27340)
Miss Islington (bot) [Sat, 24 Jul 2021 19:35:33 +0000 (12:35 -0700)] 
bpo-44676: Serialize the union type using only public API (GH-27323) (GH-27340)

Remove also the _from_args() constructor.
(cherry picked from commit 435a0334d341e5f8faed594d9f015746bb7845db)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
4 years agobpo-44731: Simplify the union type implementation (GH-27318) (GH-27334)
Ken Jin [Sat, 24 Jul 2021 14:49:25 +0000 (22:49 +0800)] 
bpo-44731: Simplify the union type implementation (GH-27318) (GH-27334)

Remove direct support of typing types in the C code because they are already supported by defining methods __or__ and __ror__ in the Python code.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
4 years ago[3.10] bpo-44676: Add ability to serialize types.Union (GH-27244) (GH-27333)
Pablo Galindo Salgado [Sat, 24 Jul 2021 14:08:53 +0000 (15:08 +0100)] 
[3.10] bpo-44676: Add ability to serialize types.Union (GH-27244) (GH-27333)

(cherry picked from commit fe13f0b0f696464dd6f283576668dbf57cb11399)

Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
4 years agobpo-44353: Improve tests covering typing.NewType pickling (GH-27302) (GH-27328)
Miss Islington (bot) [Sat, 24 Jul 2021 10:29:19 +0000 (03:29 -0700)] 
bpo-44353: Improve tests covering typing.NewType pickling (GH-27302) (GH-27328)

(cherry picked from commit a22b05da87bdfb081d6aaecfce136ae8dbb8680c)

Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
4 years ago[3.10] bpo-44353: Expand NewType tests for complex __qualname__ (GH-27311) (GH-27326)
Łukasz Langa [Sat, 24 Jul 2021 10:07:56 +0000 (12:07 +0200)] 
[3.10] bpo-44353: Expand NewType tests for complex __qualname__ (GH-27311) (GH-27326)

Make NewType pickleable by name.
(cherry picked from commit e89ef0ad2a299770a88ece8f7a316f7d3eb65c9f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
4 years agobpo-44713: [doc fix]: typo in subprocess.rst (GH-27297) (GH-27298)
Miss Islington (bot) [Sat, 24 Jul 2021 09:59:22 +0000 (02:59 -0700)] 
bpo-44713: [doc fix]: typo in subprocess.rst (GH-27297) (GH-27298)

This fixes a small typo. The code fragment should not be quoted. Thank you
@merwok for the feedback.
(cherry picked from commit 7d25254cf0763b62f4c4a3019e56385cab597b9f)

Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
4 years agobpo-44720: Don't crash when calling weakref.proxy(not_an_iterator).__next__ (GH-27316...
Miss Islington (bot) [Sat, 24 Jul 2021 09:45:13 +0000 (02:45 -0700)] 
bpo-44720: Don't crash when calling weakref.proxy(not_an_iterator).__next__ (GH-27316) (GH-27324)

(cherry picked from commit 5370f0a82aaa4ba617070d5c71d2b18236096ac0)

Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
4 years agobpo-44353: Document that typing.NewType is now a class (GH-27319) (GH-27321)
Miss Islington (bot) [Sat, 24 Jul 2021 09:31:33 +0000 (02:31 -0700)] 
bpo-44353: Document that typing.NewType is now a class (GH-27319) (GH-27321)

(cherry picked from commit 7aac3f623610cf3dffbf548a5be5bfd4fa6790a0)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
4 years agobpo-42854: Correctly use size_t for _ssl._SSLSocket.read and _ssl._SSLSocket.write...
Miss Islington (bot) [Fri, 23 Jul 2021 15:25:54 +0000 (08:25 -0700)] 
bpo-42854: Correctly use size_t for _ssl._SSLSocket.read and _ssl._SSLSocket.write (GH-27271) (GH-27308)

(cherry picked from commit 83d1430ee5b8008631e7f2a75447e740eed065c1)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
4 years agobpo-42747: Remove Py_TPFLAGS_HAVE_AM_SEND and make Py_TPFLAGS_HAVE_VERSION_TAG no...
Miss Islington (bot) [Fri, 23 Jul 2021 14:56:53 +0000 (07:56 -0700)] 
bpo-42747: Remove Py_TPFLAGS_HAVE_AM_SEND and make Py_TPFLAGS_HAVE_VERSION_TAG no-op (GH-27260) (GH-27306)

* Remove code that checks Py_TPFLAGS_HAVE_VERSION_TAG

    The field is always present in the type struct, as explained
    in the added comment.

* Remove Py_TPFLAGS_HAVE_AM_SEND

    The flag is not needed, and since it was added in 3.10 it can be removed now.
(cherry picked from commit a4760cc32d9e5dac7be262e9736eb30502cd7be3)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
4 years agobpo-29298: Fix crash with required subparsers without dest (GH-3680) (GH-27303)
Miss Islington (bot) [Fri, 23 Jul 2021 13:27:05 +0000 (06:27 -0700)] 
bpo-29298: Fix crash with required subparsers without dest (GH-3680) (GH-27303)

(cherry picked from commit 17575f73ce2cb9f3a4eb4cc416c690f9a4e7205c)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
4 years agobpo-44653: Support typing types in parameter substitution in the union type. (GH...
Miss Islington (bot) [Thu, 22 Jul 2021 22:18:49 +0000 (15:18 -0700)] 
bpo-44653: Support typing types in parameter substitution in the union type. (GH-27247) (#27296)

(cherry picked from commit 2e3744d50b6e30ea24351e55b4352dcc58fd469e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
4 years agobpo-44708: Only re-run test methods that match names of previously failing test metho...
Miss Islington (bot) [Thu, 22 Jul 2021 20:30:44 +0000 (13:30 -0700)] 
bpo-44708: Only re-run test methods that match names of previously failing test methods (GH-27287) (GH-27290)

* Move to a static argparse.Namespace subclass
* Roughly annotate runtest.py
* Refactor libregrtest to use lossless test result objects
* Only re-run test methods that match names of previously failing test methods
* Adopt tests to cover test method name matching

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
(cherry picked from commit f1afef5e0d93d66fbf3c9aaeab8b3b8da9617583)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agobpo-14879: [doc] clarify how to check for errors from subprocess.Popen(..., shell...
Miss Islington (bot) [Thu, 22 Jul 2021 18:25:57 +0000 (11:25 -0700)] 
bpo-14879: [doc] clarify how to check for errors from subprocess.Popen(..., shell=True) (GH-26755) (GH-27288)

(cherry picked from commit 50ffbe3dafcae7826d114df61d56c7ac45a6358c)

Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
4 years agoFix typo in collections.rst (GH-27270) (#27285)
Miss Islington (bot) [Thu, 22 Jul 2021 08:38:22 +0000 (01:38 -0700)] 
Fix typo in collections.rst (GH-27270) (#27285)

4 years agobpo-44704: Make Set._hash consistent with frozenset.__hash__ (GH-27281) (GH-27282)
Miss Islington (bot) [Thu, 22 Jul 2021 00:23:21 +0000 (17:23 -0700)] 
bpo-44704: Make Set._hash consistent with frozenset.__hash__ (GH-27281) (GH-27282)

4 years agobpo-30511: Add note on thread safety to shutil.make_archive() (GH-26933) (GH-27274)
Miss Islington (bot) [Wed, 21 Jul 2021 08:55:22 +0000 (01:55 -0700)] 
bpo-30511: Add note on thread safety to shutil.make_archive() (GH-26933) (GH-27274)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 64f54b7ccd49764b0304e076bfd79b5482988f53)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
4 years agobpo-44566: resolve differences between asynccontextmanager and contextmanager (GH...
Miss Islington (bot) [Tue, 20 Jul 2021 19:12:47 +0000 (12:12 -0700)] 
bpo-44566: resolve differences between asynccontextmanager and contextmanager (GH-27024) (#27266)

(cherry picked from commit 7f1c330da31c54e028dceaf3610877914c2a4497)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
4 years ago[3.10] bpo-43219: skip Solaris in the test as well (GH-27257) (GH-27268)
Miss Islington (bot) [Tue, 20 Jul 2021 18:53:31 +0000 (11:53 -0700)] 
[3.10] bpo-43219: skip Solaris in the test as well (GH-27257) (GH-27268)

(cherry picked from commit 6564656495d456a1bcc1aaa06abfc696209f37b2)

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
Automerge-Triggered-By: GH:gpshead
4 years agoUpdate macOS build-installer script comments for 3.10 and remove unused pre-10.5...
Miss Islington (bot) [Tue, 20 Jul 2021 17:30:29 +0000 (10:30 -0700)] 
Update macOS build-installer script comments for 3.10 and remove unused pre-10.5 vestiges. (GH-27253)

(cherry picked from commit 42205ee512159de62c01e202ff799d78fac9ac26)

Co-authored-by: Ned Deily <nad@python.org>
4 years agobpo-44353: Add test to cover __or__ of two NewType (GH-27259) (#27261)
Miss Islington (bot) [Tue, 20 Jul 2021 16:06:38 +0000 (09:06 -0700)] 
bpo-44353: Add test to cover __or__ of two NewType (GH-27259) (#27261)

(cherry picked from commit 4868b94c6089d457673b1ba5b5b64c2f38c435af)

Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
4 years agobpo-44353: Refactor typing.NewType into callable class (GH-27250) (#27258)
Miss Islington (bot) [Tue, 20 Jul 2021 15:24:57 +0000 (08:24 -0700)] 
bpo-44353: Refactor typing.NewType into callable class (GH-27250) (#27258)

(cherry picked from commit 965dd76e9060e27e2253ba8c8d21a142b178720d)

Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
4 years agobpo-44524: Add missed __name__ and __qualname__ to typing module objects (GH-27237...
Miss Islington (bot) [Mon, 19 Jul 2021 17:57:27 +0000 (10:57 -0700)] 
bpo-44524: Add missed __name__ and __qualname__ to typing module objects (GH-27237) (#27246)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
(cherry picked from commit bce1418541a64a793960182772f985f64afbfa1a)

Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
4 years agobpo-27513: email.utils.getaddresses() now handles Header objects (GH-13797) (GH-27242)
Miss Islington (bot) [Mon, 19 Jul 2021 16:54:45 +0000 (09:54 -0700)] 
bpo-27513: email.utils.getaddresses() now handles Header objects (GH-13797) (GH-27242)

getaddresses() should be able to handle a Header object if passed
one.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 89f4c34797de2f0e5045da2b97c1c8cbbb42fbb2)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
4 years agoClean up comma usage in Doc/library/functions.rst (GH-27083) (#27243)
Miss Islington (bot) [Mon, 19 Jul 2021 16:38:56 +0000 (09:38 -0700)] 
Clean up comma usage in Doc/library/functions.rst (GH-27083) (#27243)

(cherry picked from commit 1e651c6adad8e4e772a15eaa9ee659b1283a96d9)

Co-authored-by: α∂мιηιχтяαтσя <sadiqherritage@gmail.com>
4 years agobpo-44490: Improve typing module compatibility with types.Union (GH-27048) (#27222)
Ken Jin [Mon, 19 Jul 2021 14:22:59 +0000 (22:22 +0800)] 
bpo-44490: Improve typing module compatibility with types.Union (GH-27048) (#27222)

(cherry picked from commit bf89ff96e6ba21bb52b8597b5e51e8ffc57e6589)

Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
4 years agobpo-44645: Check for interrupts on any potentially backwards edge (GH-27216) (GH...
Miss Islington (bot) [Mon, 19 Jul 2021 11:15:58 +0000 (04:15 -0700)] 
bpo-44645: Check for interrupts on any potentially backwards edge (GH-27216) (GH-27235)

(cherry picked from commit d09c13417890427f829e3df297beb0e27133f8f4)

Co-authored-by: Mark Shannon <mark@hotpy.org>
4 years ago[3.10] bpo-44561: Update hyperlinks in Doc/distributing/index.rst (GH-27032) (GH...
Miss Islington (bot) [Mon, 19 Jul 2021 00:34:44 +0000 (17:34 -0700)] 
[3.10] bpo-44561: Update hyperlinks in Doc/distributing/index.rst (GH-27032) (GH-27234)

* Update hyperlinks in Doc/distributing/index.rst

Update three expired hyperlinks.

Closes [bpo-44561]().
(cherry picked from commit b494685b2548489efcc66993cc6c13b027ce3b26)

Co-authored-by: Steven Hsu <hsuhaochun@gmail.com>
Automerge-Triggered-By: GH:ncoghlan
4 years agoCorrect the order of check-abidump (GH-27229)
Pablo Galindo Salgado [Sun, 18 Jul 2021 15:56:45 +0000 (16:56 +0100)] 
Correct the order of check-abidump (GH-27229)

The check was backwards so we were not correctly detecting removals.

4 years ago[3.10] bpo-44654: Do not export the union type related symbols (GH-27223). (GH-27225)
Serhiy Storchaka [Sun, 18 Jul 2021 15:37:41 +0000 (18:37 +0300)] 
[3.10] bpo-44654: Do not export the union type related symbols (GH-27223). (GH-27225)

(cherry picked from commit 8f50f44592190b5a8cb115f0d58d577036e68308)

4 years agobpo-44633: Fix parameter substitution of the union type with wrong types. (GH-27218...
Miss Islington (bot) [Sun, 18 Jul 2021 11:59:25 +0000 (04:59 -0700)] 
bpo-44633: Fix parameter substitution of the union type with wrong types. (GH-27218) (GH-27224)

A TypeError is now raised instead of returning NotImplemented.
(cherry picked from commit 3ea5332a4365bdd771286b3e9692495116e9ceef)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
4 years ago[3.10] bpo-44654: Refactor and clean up the union type implementation (GH-27196)...
Miss Islington (bot) [Sat, 17 Jul 2021 21:10:21 +0000 (14:10 -0700)] 
[3.10] bpo-44654: Refactor and clean up the union type implementation (GH-27196) (GH-27219)

(cherry picked from commit 0fd27375cabd12e68a2f12cfeca11a2d5043429e)

4 years ago[3.10] bpo-44490: Add __parameters__ and __getitem__ to types.Union (GH-26980) (GH...
Serhiy Storchaka [Sat, 17 Jul 2021 19:14:57 +0000 (22:14 +0300)] 
[3.10] bpo-44490: Add __parameters__ and __getitem__ to types.Union (GH-26980) (GH-27207)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>.
(cherry picked from commit c45fa1a5d9b419cf13ad4b5a7cb453956495b83e)

Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
4 years agoReplace @ilevkivskyi with @Fidget-Spinner as typing code owner (GH-27210) (#27212)
Miss Islington (bot) [Sat, 17 Jul 2021 09:46:25 +0000 (02:46 -0700)] 
Replace @ilevkivskyi with @Fidget-Spinner as typing code owner (GH-27210) (#27212)

(cherry picked from commit 311ee83adb40a9b549af8e0b546a787e8eb01f5d)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agobpo-41249: Fix postponed annotations for TypedDict (GH-27017) (#27204)
Miss Islington (bot) [Sat, 17 Jul 2021 08:48:17 +0000 (01:48 -0700)] 
bpo-41249: Fix postponed annotations for TypedDict (GH-27017) (#27204)

This fixes TypedDict to work with get_type_hints and postponed evaluation of annotations across modules.

This is done by adding the module name to ForwardRef at the time the object is created and using that to resolve the globals during the evaluation.

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
(cherry picked from commit 889036f7ef7290ef15b6c3373023f6a35387af0c)

Co-authored-by: Germán Méndez Bravo <german.mb@gmail.com>
4 years agobpo-44655: Include the name of the type in unset __slots__ attribute errors (GH-27199...
Miss Islington (bot) [Sat, 17 Jul 2021 00:01:53 +0000 (17:01 -0700)] 
bpo-44655: Include the name of the type in unset __slots__ attribute errors (GH-27199) (GH-27201)

(cherry picked from commit f783428a2313a729ca8b539c5a86ff114b9ff375)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
4 years agobpo-44655: Don't include suggestions for attributes that are the same as the missing...
Miss Islington (bot) [Fri, 16 Jul 2021 21:16:08 +0000 (14:16 -0700)] 
bpo-44655: Don't include suggestions for attributes that are the same as the missing one (GH-27197) (GH-27198)

(cherry picked from commit 6714dec5e104bdee4a0ed4d9966de27d1bfa1e3d)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
4 years agoRevert "bpo-44645: Check for interrupts on any potentially backwards edge. (GH-27167...
Miss Islington (bot) [Fri, 16 Jul 2021 17:29:32 +0000 (10:29 -0700)] 
Revert "bpo-44645: Check for interrupts on any potentially backwards edge. (GH-27167)" (GH-27194) (#27195)

This reverts commit 000e70ad5246732fcbd27cf59268185cbd5ad734.
(cherry picked from commit c90c591e5158ab7b531dcd6e2a5f00bc70ba7637)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
4 years agobpo-44647: Add a permanent Unicode-valued env var to regrtest (GH-27187) (#27191)
Miss Islington (bot) [Fri, 16 Jul 2021 13:55:26 +0000 (06:55 -0700)] 
bpo-44647: Add a permanent Unicode-valued env var to regrtest  (GH-27187) (#27191)

(cherry picked from commit 7915c96ffd7ddc5cb6d54015ee4c31255a416892)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years ago[3.10] bpo-44652: Preserve natural order of args in the union type. (GH-27185) (GH...
Serhiy Storchaka [Fri, 16 Jul 2021 13:42:04 +0000 (16:42 +0300)] 
[3.10] bpo-44652: Preserve natural order of args in the union type. (GH-27185) (GH-27190)

(cherry picked from commit 0cd2d51aadcd2a0c0739a5df0a6235d64f35619e)

Automerge-Triggered-By: GH:ambv
4 years agobpo-40897:Give priority to using the current class constructor in `inspect.signature...
Miss Islington (bot) [Fri, 16 Jul 2021 13:25:57 +0000 (06:25 -0700)] 
bpo-40897:Give priority to using the current class constructor in `inspect.signature` (GH-27177) (#27189)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 6aab5f9bf303a8e4cd8377fabcdcb499e0541f9a)

Co-authored-by: Weipeng Hong <hongweichen8888@sina.com>
4 years ago[3.10] bpo-44636: Collapse union of equal types (GH-27178) (GH-27181)
Serhiy Storchaka [Fri, 16 Jul 2021 11:48:20 +0000 (14:48 +0300)] 
[3.10] bpo-44636: Collapse union of equal types (GH-27178) (GH-27181)

The result of `int | int` is now `int`.

Fix comparison of the union type with non-hashable objects.
`int | str == {}` no longer raises a TypeError.
(cherry picked from commit d9f923280f204204f8703756aef4f655b579b4b8)

4 years agobpo-44626: Merge basic blocks earlier to enable better handling of exit blocks withou...
Mark Shannon [Fri, 16 Jul 2021 10:49:10 +0000 (11:49 +0100)] 
bpo-44626: Merge basic blocks earlier to enable better handling of exit blocks without line numbers (GH-27138) (GH-27182)

(cherry picked from commit a86f7dae0acf918d54086cb85e5a0b0bedeedce7)

4 years ago[3.10] bpo-44645: Check for interrupts on any potentially backwards edge. (GH-27167...
Mark Shannon [Fri, 16 Jul 2021 10:48:46 +0000 (11:48 +0100)] 
[3.10] bpo-44645: Check for interrupts on any potentially backwards edge. (GH-27167) (GH-27183)

(cherry picked from commit 000e70ad5246732fcbd27cf59268185cbd5ad734)

Co-authored-by: Mark Shannon <mark@hotpy.org>
4 years agobpo-44646: Fix the hash of the union type. (GH-27179) (#27180)
Miss Islington (bot) [Fri, 16 Jul 2021 09:02:59 +0000 (02:02 -0700)] 
bpo-44646: Fix the hash of the union type. (GH-27179) (#27180)

It no longer depends on the order of arguments.
hash(int | str) == hash(str | int)

Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
(cherry picked from commit aeaa553d650786afc6e68df1f4813ae1a5b71d05)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
4 years agobpo-44184: Apply GH-26274 to the non-GC-type branch of subtype_dealloc (GH-27165...
Miss Islington (bot) [Thu, 15 Jul 2021 23:18:16 +0000 (16:18 -0700)] 
bpo-44184: Apply GH-26274 to the non-GC-type branch of subtype_dealloc (GH-27165) (GH-27174)

The non-GC-type branch of subtype_dealloc is using the type of an object after freeing in the same unsafe way as GH-26274 fixes. (I believe the old news entry covers this change well enough.)

https://bugs.python.org/issue44184
(cherry picked from commit 074e7659f208051b6b973f7fdb654dd22b93aaa2)

Co-authored-by: T. Wouters <thomas@python.org>
4 years agobpo-44647: Fix test_httpservers failing on Unicode characters in os.environ on Window...
Miss Islington (bot) [Thu, 15 Jul 2021 20:09:26 +0000 (13:09 -0700)] 
bpo-44647: Fix test_httpservers failing on Unicode characters in os.environ on Windows (GH-27161) (#27169)

GH-23638 introduced a new test for Accept: headers in CGI HTTP servers. This test serializes all of os.environ on the server side. For non-UTF8 locales this can fail for some Unicode characters found in environment variables. This change fixes the HTTP_ACCEPT test.
(cherry picked from commit 82b218f36ce6ef910bda5af227a9fd5be613c94f)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
4 years agobpo-44622: Set line number of END_ASYNC_FOR to match that of iterator. (GH-27160...
Mark Shannon [Thu, 15 Jul 2021 14:54:38 +0000 (15:54 +0100)] 
bpo-44622: Set line number of END_ASYNC_FOR to match that of iterator. (GH-27160) (GH-27163)

(cherry picked from commit f333ab0f2edec26a769ed558263ac662e5475451)

4 years agobpo-42073: allow classmethod to wrap other classmethod-like descriptors (GH-27115...
Miss Islington (bot) [Thu, 15 Jul 2021 13:42:11 +0000 (06:42 -0700)] 
bpo-42073: allow classmethod to wrap other classmethod-like descriptors (GH-27115) (GH-27162)

Patch by Erik Welch.

bpo-19072 (GH-8405) allows `classmethod` to wrap other descriptors, but this does
not work when the wrapped descriptor mimics classmethod.  The current PR fixes
this.

In Python 3.8 and before, one could create a callable descriptor such that this
works as expected (see Lib/test/test_decorators.py for examples):
```python
class A:
    @myclassmethod
    def f1(cls):
        return cls

    @classmethod
    @myclassmethod
    def f2(cls):
        return cls
```
In Python 3.8 and before, `A.f2()` return `A`. Currently in Python 3.9, it
returns `type(A)`.  This PR make `A.f2()` return `A` again.

As of GH-8405, classmethod calls `obj.__get__(type)` if `obj` has `__get__`.
This allows one to chain `@classmethod` and `@property` together.  When
using classmethod-like descriptors, it's the second argument to `__get__`--the
owner or the type--that is important, but this argument is currently missing.
Since it is None, the "owner" argument is assumed to be the type of the first
argument, which, in this case, is wrong (we want `A`, not `type(A)`).

This PR updates classmethod to call `obj.__get__(type, type)` if `obj` has
`__get__`.

Co-authored-by: Erik Welch <erik.n.welch@gmail.com>
(cherry picked from commit b83861f0265e07207a6ae2c49c40fa8f447893f2)

4 years agoFix osx_framework_user include to match distutils (GH-27093) (GH-27159)
Miss Islington (bot) [Thu, 15 Jul 2021 10:10:57 +0000 (03:10 -0700)] 
Fix osx_framework_user include to match distutils (GH-27093) (GH-27159)

(cherry picked from commit 28544609cb2a79d8d7ea5a54714d723669ef2adb)

Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
4 years agobpo-44632: Fix support of TypeVar in the union type (GH-27139) (GH-27143)
Miss Islington (bot) [Thu, 15 Jul 2021 07:25:22 +0000 (00:25 -0700)] 
bpo-44632: Fix support of TypeVar in the union type (GH-27139) (GH-27143)

int | TypeVar('T') returns now an instance of types.Union
instead of typing.Union.
(cherry picked from commit a158b20019b50e3ece6e4743ec4e6ae8d818b690)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
4 years ago[3.10] bpo-44635: Convert None to NoneType in the union type constructor (GH-27136...
Serhiy Storchaka [Thu, 15 Jul 2021 07:15:14 +0000 (10:15 +0300)] 
[3.10] bpo-44635: Convert None to NoneType in the union type constructor (GH-27136). (GH-27142)

(cherry picked from commit b81cac05606c84958b52ada09f690463a3c7e949)

4 years ago[3.10] bpo-44589: raise a SyntaxError when mapping patterns have duplicate literal...
Miss Islington (bot) [Thu, 15 Jul 2021 01:00:35 +0000 (18:00 -0700)] 
[3.10] bpo-44589: raise a SyntaxError when mapping patterns have duplicate literal keys (GH-27131) (GH-27157)

(cherry picked from commit 2693132292b2acf381ac6fa729bf3acf41d9d72b)

Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
Automerge-Triggered-By: GH:brandtbucher