This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add ability to serialise types.Union
Type: enhancement Stage: resolved
Components: Interpreter Core, Library (Lib) Versions: Python 3.11, Python 3.10
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: kj, lukasz.langa, miss-islington, pablogsal, serhiy.storchaka, uriyyo
Priority: normal Keywords: patch

Created on 2021-07-19 16:20 by uriyyo, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 27244 merged uriyyo, 2021-07-19 16:56
PR 27323 merged serhiy.storchaka, 2021-07-24 09:15
PR 27332 merged pablogsal, 2021-07-24 13:25
PR 27333 merged pablogsal, 2021-07-24 13:50
PR 27335 closed kj, 2021-07-24 15:48
PR 27340 merged miss-islington, 2021-07-24 18:26
Messages (9)
msg397814 - (view) Author: Yurii Karabas (uriyyo) * (Python triager) Date: 2021-07-19 16:20
It was discussed at https://bugs.python.org/issue44490
msg398041 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-07-23 09:47
New changeset fe13f0b0f696464dd6f283576668dbf57cb11399 by Yurii Karabas in branch 'main':
bpo-44676: Add ability to serialize types.Union (GH-27244)
https://github.com/python/cpython/commit/fe13f0b0f696464dd6f283576668dbf57cb11399
msg398125 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-07-24 09:12
It is not good to use private method in pickle, because we will not be able to get rid of it for backward compatibility. Why not use functools.reduce()?
msg398153 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2021-07-24 13:18
This PR has introduced reference leaks. Bisecting points to:

fe13f0b0f696464dd6f283576668dbf57cb11399 is the first bad commit
commit fe13f0b0f696464dd6f283576668dbf57cb11399
Author: Yurii Karabas <1998uriyyo@gmail.com>
Date:   Fri Jul 23 12:47:00 2021 +0300

    bpo-44676: Add ability to serialize types.Union (GH-27244)

 Lib/test/test_types.py                             | 35 +++++++++++++++
 Lib/typing.py                                      |  4 +-
 .../2021-07-19-19-53-46.bpo-44676.WgIMvh.rst       |  2 +
 Objects/unionobject.c                              | 51 ++++++++++++++++++++++
 4 files changed, 90 insertions(+), 2 deletions(-)
 create mode 100644 Misc/NEWS.d/next/Core and Builtins/2021-07-19-19-53-46.bpo-44676.WgIMvh.rst
bisect run successfe13f0b0f696464dd6f283576668dbf57cb11399 is the first bad commit
commit fe13f0b0f696464dd6f283576668dbf57cb11399
Author: Yurii Karabas <1998uriyyo@gmail.com>
Date:   Fri Jul 23 12:47:00 2021 +0300

    bpo-44676: Add ability to serialize types.Union (GH-27244)

 Lib/test/test_types.py                             | 35 +++++++++++++++
 Lib/typing.py                                      |  4 +-
 .../2021-07-19-19-53-46.bpo-44676.WgIMvh.rst       |  2 +
 Objects/unionobject.c                              | 51 ++++++++++++++++++++++
 4 files changed, 90 insertions(+), 2 deletions(-)
 create mode 100644 Misc/NEWS.d/next/Core and Builtins/2021-07-19-19-53-46.bpo-44676.WgIMvh.rst
bisect run success

Example failure:

https://buildbot.python.org/all/#/builders/259/builds/100

Ran 106 tests in 0.053s
OK
......
test_types leaked [2, 2, 2] references, sum=6
test_types leaked [1, 1, 1] memory blocks, sum=3
1 test failed again:
    test_types
== Tests result: FAILURE then FAILURE ==
413 tests OK.
msg398156 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2021-07-24 14:08
New changeset 9356d1e47de583fd794e9d29abc448759f7a4109 by Pablo Galindo Salgado in branch '3.10':
[3.10] bpo-44676: Add ability to serialize types.Union (GH-27244) (GH-27333)
https://github.com/python/cpython/commit/9356d1e47de583fd794e9d29abc448759f7a4109
msg398158 - (view) Author: miss-islington (miss-islington) Date: 2021-07-24 14:26
New changeset 8158e059e9952f08d19a18d3e9e021cee2393cd2 by Pablo Galindo Salgado in branch 'main':
bpo-44676: Fix reference leaks in union_reduce (GH-27332)
https://github.com/python/cpython/commit/8158e059e9952f08d19a18d3e9e021cee2393cd2
msg398171 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-07-24 18:26
New changeset 435a0334d341e5f8faed594d9f015746bb7845db by Serhiy Storchaka in branch 'main':
bpo-44676: Serialize the union type using only public API (GH-27323)
https://github.com/python/cpython/commit/435a0334d341e5f8faed594d9f015746bb7845db
msg398174 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-07-24 19:36
New changeset 0aea99e44416f37c75e5540072156dbf90ef1659 by Miss Islington (bot) in branch '3.10':
bpo-44676: Serialize the union type using only public API (GH-27323) (GH-27340)
https://github.com/python/cpython/commit/0aea99e44416f37c75e5540072156dbf90ef1659
msg398178 - (view) Author: Ken Jin (kj) * (Python committer) Date: 2021-07-25 02:23
This is fixed. Thanks Yurii and Serhiy for the patches :) (and everyone else for the reviews too).
History
Date User Action Args
2022-04-11 14:59:47adminsetgithub: 88842
2021-07-25 02:23:58kjsetstatus: open -> closed

messages: + msg398178
stage: patch review -> resolved
2021-07-24 19:36:07serhiy.storchakasetmessages: + msg398174
2021-07-24 18:26:34miss-islingtonsetpull_requests: + pull_request25883
2021-07-24 18:26:06serhiy.storchakasetmessages: + msg398171
2021-07-24 17:18:07serhiy.storchakasetcomponents: + Interpreter Core, Library (Lib)
versions: + Python 3.10
2021-07-24 15:48:42kjsetnosy: + kj
pull_requests: + pull_request25878
2021-07-24 14:26:03miss-islingtonsetnosy: + miss-islington
messages: + msg398158
2021-07-24 14:08:56pablogsalsetmessages: + msg398156
2021-07-24 13:50:30pablogsalsetpull_requests: + pull_request25876
2021-07-24 13:25:21pablogsalsetpull_requests: + pull_request25875
2021-07-24 13:18:25pablogsalsetnosy: + pablogsal
messages: + msg398153
2021-07-24 09:15:20serhiy.storchakasetstage: resolved -> patch review
pull_requests: + pull_request25867
2021-07-24 09:12:29serhiy.storchakasetstatus: closed -> open
nosy: + serhiy.storchaka
messages: + msg398125

2021-07-23 09:47:25lukasz.langasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-07-23 09:47:11lukasz.langasetnosy: + lukasz.langa
messages: + msg398041
2021-07-19 16:56:09uriyyosetkeywords: + patch
stage: patch review
pull_requests: + pull_request25792
2021-07-19 16:52:48uriyyosettype: enhancement
2021-07-19 16:20:20uriyyosetversions: + Python 3.11
2021-07-19 16:20:13uriyyocreate