Skip to content

Add ability to serialise types.Union #88842

Closed

Description

@uriyyo
BPO 44676
Nosy @ambv, @serhiy-storchaka, @pablogsal, @miss-islington, @uriyyo, @Fidget-Spinner
PRs
  • bpo-44676: Add ability to serialise types.Union #27244
  • bpo-44676: Serialize the union type using only public API #27323
  • bpo-44676: Fix reference leaks in union_reduce #27332
  • [3.10] bpo-44676: Add ability to serialize types.Union (GH-27244) #27333
  • [3.10] Partially revert "bpo-44676: Add ability to serialize types.Union (GH-27244) (GH-27333)" #27335
  • [3.10] bpo-44676: Serialize the union type using only public API (GH-27323) #27340
  • 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']

    Activity

    1. uriyyo commented on Jul 19, 2021

      @uriyyo
      MemberAuthor
    2. added
      3.11only security fixes
      type-featureA feature request or enhancement
      on Jul 19, 2021
    3. ambv commented on Jul 23, 2021

      @ambv
      Contributor

      New changeset fe13f0b by Yurii Karabas in branch 'main':
      bpo-44676: Add ability to serialize types.Union (GH-27244)
      fe13f0b

    4. serhiy-storchaka commented on Jul 24, 2021

      @serhiy-storchaka
      Member

      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()?

    5. pablogsal commented on Jul 24, 2021

      @pablogsal
      Member

      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

      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 fe13f0b
      Author: Yurii Karabas <[email protected]>
      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.

    6. pablogsal commented on Jul 24, 2021

      @pablogsal
      Member

      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

    7. miss-islington commented on Jul 24, 2021

      @miss-islington
      Contributor

      New changeset 8158e05 by Pablo Galindo Salgado in branch 'main':
      bpo-44676: Fix reference leaks in union_reduce (GH-27332)
      8158e05

    8. added
      interpreter-core(Objects, Python, Grammar, and Parser dirs)
      stdlibStandard Library Python modules in the Lib/ directory
      on Jul 24, 2021
    9. serhiy-storchaka commented on Jul 24, 2021

      @serhiy-storchaka
      Member

      New changeset 435a033 by Serhiy Storchaka in branch 'main':
      bpo-44676: Serialize the union type using only public API (GH-27323)
      435a033

    10. serhiy-storchaka commented on Jul 24, 2021

      @serhiy-storchaka
      Member

      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

    11. Fidget-Spinner commented on Jul 25, 2021

      @Fidget-Spinner
      Member

      This is fixed. Thanks Yurii and Serhiy for the patches :) (and everyone else for the reviews too).

    12. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.10 (EOL)end of life3.11only security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions