Repository navigation
Add ability to serialise types.Union #88842
Copy link
Copy link
Closed
Labels
3.10 (EOL)end of lifeend of life3.11only security fixesonly security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement
Description
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = None
closed_at = <Date 2021-07-25.02:23:58.254>
created_at = <Date 2021-07-19.16:20:13.599>
labels = ['interpreter-core', 'type-feature', 'library', '3.10', '3.11']
title = 'Add ability to serialise types.Union'
updated_at = <Date 2021-07-25.02:23:58.253>
user = 'https://github.com/uriyyo'bugs.python.org fields:
activity = <Date 2021-07-25.02:23:58.253>
actor = 'kj'
assignee = 'none'
closed = True
closed_date = <Date 2021-07-25.02:23:58.254>
closer = 'kj'
components = ['Interpreter Core', 'Library (Lib)']
creation = <Date 2021-07-19.16:20:13.599>
creator = 'uriyyo'
dependencies = []
files = []
hgrepos = []
issue_num = 44676
keywords = ['patch']
message_count = 9.0
messages = ['397814', '398041', '398125', '398153', '398156', '398158', '398171', '398174', '398178']
nosy_count = 6.0
nosy_names = ['lukasz.langa', 'serhiy.storchaka', 'pablogsal', 'miss-islington', 'uriyyo', 'kj']
pr_nums = ['27244', '27323', '27332', '27333', '27335', '27340']
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue44676'
versions = ['Python 3.10', 'Python 3.11']Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
3.10 (EOL)end of lifeend of life3.11only security fixesonly security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement
Activity
uriyyo commentedon Jul 19, 2021
It was discussed at https://bugs.python.org/issue44490
ambv commentedon Jul 23, 2021
New changeset fe13f0b by Yurii Karabas in branch 'main':
bpo-44676: Add ability to serialize types.Union (GH-27244)
fe13f0b
serhiy-storchaka commentedon Jul 24, 2021
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()?
pablogsal commentedon Jul 24, 2021
This PR has introduced reference leaks. Bisecting points to:
fe13f0b is the first bad commit
commit fe13f0b
Author: Yurii Karabas <[email protected]>
Date: Fri Jul 23 12:47:00 2021 +0300
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 fe13f0b
Author: Yurii Karabas <[email protected]>
Date: Fri Jul 23 12:47:00 2021 +0300
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.
pablogsal commentedon Jul 24, 2021
New changeset 9356d1e by Pablo Galindo Salgado in branch '3.10':
[3.10] bpo-44676: Add ability to serialize types.Union (GH-27244) (GH-27333)
9356d1e
miss-islington commentedon Jul 24, 2021
New changeset 8158e05 by Pablo Galindo Salgado in branch 'main':
bpo-44676: Fix reference leaks in union_reduce (GH-27332)
8158e05
serhiy-storchaka commentedon Jul 24, 2021
New changeset 435a033 by Serhiy Storchaka in branch 'main':
bpo-44676: Serialize the union type using only public API (GH-27323)
435a033
serhiy-storchaka commentedon Jul 24, 2021
New changeset 0aea99e by Miss Islington (bot) in branch '3.10':
bpo-44676: Serialize the union type using only public API (GH-27323) (GH-27340)
0aea99e
Fidget-Spinner commentedon Jul 25, 2021
This is fixed. Thanks Yurii and Serhiy for the patches :) (and everyone else for the reviews too).