Skip to content

Simplify implementation of the union type #88894

Closed

Description

@serhiy-storchaka
BPO 44731
Nosy @gvanrossum, @serhiy-storchaka, @pablogsal, @uriyyo, @Fidget-Spinner
PRs
  • bpo-44731: Simplify the union type implementation #27318
  • [3.10] bpo-44731: Simplify the union type implementation (GH-27318) #27334
  • 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-24.14:50:23.547>
    created_at = <Date 2021-07-24.07:04:29.579>
    labels = ['interpreter-core', 'type-feature', '3.11']
    title = 'Simplify implementation of the union type'
    updated_at = <Date 2021-07-24.14:50:23.546>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2021-07-24.14:50:23.546>
    actor = 'pablogsal'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-07-24.14:50:23.547>
    closer = 'pablogsal'
    components = ['Interpreter Core']
    creation = <Date 2021-07-24.07:04:29.579>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 44731
    keywords = ['patch']
    message_count = 4.0
    messages = ['398119', '398124', '398155', '398160']
    nosy_count = 5.0
    nosy_names = ['gvanrossum', 'serhiy.storchaka', 'pablogsal', 'uriyyo', 'kj']
    pr_nums = ['27318', '27334']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue44731'
    versions = ['Python 3.11']

    Activity

    1. serhiy-storchaka commented on Jul 24, 2021

      @serhiy-storchaka
      MemberAuthor

      The proposed PR simplifies implementation of the union type by removing direct support of typing types. It was not necessary because all these types implement __or__ and __ror__ methods.

      The only visible difference is that int | TypeVar() etc returns now typing.Union instead of types.Union. But TypeVar() | int already returns typing.Union.

    2. serhiy-storchaka commented on Jul 24, 2021

      @serhiy-storchaka
      MemberAuthor

      It fixes also bpo-44642.

    3. pablogsal commented on Jul 24, 2021

      @pablogsal
      Member

      New changeset 0828423 by Serhiy Storchaka in branch 'main':
      bpo-44731: Simplify the union type implementation (GH-27318)
      0828423

    4. pablogsal commented on Jul 24, 2021

      @pablogsal
      Member

      New changeset ca5a4cf by Ken Jin in branch '3.10':
      bpo-44731: Simplify the union type implementation (GH-27318) (GH-27334)
      ca5a4cf

    5. 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.11only security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions