GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Rename types.Union to types.UnionType · Issue #88895 · python/cpython

Rename types.Union to types.UnionType #88895

New issue
Copy link
New issue
Copy link
Closed
Closed
Rename types.Union to types.UnionType#88895
Copy link
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)

Description

@serhiy-storchaka
serhiy-storchaka
opened on Jul 24, 2021
Issue body actions
BPO 44732
Nosy @gvanrossum, @ambv, @serhiy-storchaka, @JelleZijlstra, @pablogsal, @miss-islington, @AliyevH, @Fidget-Spinner
PRs
  • bpo-44732: Rename types.Union to types.UnionType #27342
  • [3.10] bpo-44732: Rename types.Union to types.UnionType (GH-27342) #27365
  • 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-26.19:03:15.666>
    created_at = <Date 2021-07-24.09:24:20.429>
    labels = ['interpreter-core', '3.10', '3.11']
    title = 'Rename types.Union to types.UnionType'
    updated_at = <Date 2021-07-26.19:03:15.666>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2021-07-26.19:03:15.666>
    actor = 'pablogsal'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-07-26.19:03:15.666>
    closer = 'pablogsal'
    components = ['Interpreter Core']
    creation = <Date 2021-07-24.09:24:20.429>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 44732
    keywords = ['patch']
    message_count = 8.0
    messages = ['398128', '398130', '398177', '398185', '398190', '398210', '398238', '398247']
    nosy_count = 8.0
    nosy_names = ['gvanrossum', 'lukasz.langa', 'serhiy.storchaka', 'JelleZijlstra', 'pablogsal', 'miss-islington', 'AliyevH', 'kj']
    pr_nums = ['27342', '27365']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue44732'
    versions = ['Python 3.10', 'Python 3.11']

    Activity

    1. serhiy-storchaka commented on Jul 24, 2021

      @serhiy-storchaka
      serhiy-storchaka
      on Jul 24, 2021
      MemberAuthor
      More actions

      There are differences between typing.Union and types.Union:

      • typing.Union is indexable, types.Union is not.
      • types.Union is a class, typing.Union is not.

      types.Union corresponds to typing._UnionGenericAlias, not typing.Union. It is confusing that typing.Union and types.Union have the same name. Note also that most classes in the types module have the "Type" suffix: FunctionType, MethodType, ModuleType, etc. I think that it would be better to rename types.Union to types.UnionType.

    2. serhiy-storchaka
      added
      3.10 (EOL)end of lifeend of life
      3.11only security fixesonly security fixes
      interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
      on Jul 24, 2021
    3. AliyevH commented on Jul 24, 2021

      @AliyevH
      AliyevHmannequin
      on Jul 24, 2021
      Mannequin
      More actions

      If nobody works on it i would like to fix it

    4. AliyevH commented on Jul 25, 2021

      @AliyevH
      AliyevHmannequin
      on Jul 25, 2021
      Mannequin
      More actions

      should have a deprecation period and if so, how long?

    5. pablogsal commented on Jul 25, 2021

      @pablogsal
      pablogsal
      on Jul 25, 2021
      Member
      More actions

      This is a feature added to 3.10 so if we change it before the release there is no deprecation period needed. On the other hand if we don't get it to 3.10 is going to be much difficult to rename.

    6. gvanrossum commented on Jul 25, 2021

      @gvanrossum
      gvanrossum
      on Jul 25, 2021
      Member
      More actions

      Agreed. I think we should do it, Serhiy’s reasoning makes sense.

      We should just update the PEP and add a note that this was changed during the beta period.

    7. JelleZijlstra commented on Jul 26, 2021

      @JelleZijlstra
      JelleZijlstra
      on Jul 26, 2021
      Member
      More actions

      I agree that UnionType is marginally better so we should rename it. It doesn't seem worth doing if this doesn't make it in in time for 3.10, though. With the advent of PEP-604 typing.Union will hopefully become irrelevant.

    8. ambv commented on Jul 26, 2021

      @ambv
      ambv
      on Jul 26, 2021
      Contributor
      More actions

      New changeset 2b8ad9e by Hasan in branch 'main':
      bpo-44732: Rename types.Union to types.UnionType (bpo-27342)
      2b8ad9e

    9. miss-islington commented on Jul 26, 2021

      @miss-islington
      miss-islington
      on Jul 26, 2021
      Contributor
      More actions

      New changeset 8a37e8c by Miss Islington (bot) in branch '3.10':
      bpo-44732: Rename types.Union to types.UnionType (GH-27342)
      8a37e8c

    10. pablogsal
      closed this as completedon Jul 26, 2021
    11. pablogsal
      closed this as completedon Jul 26, 2021
    12. ezio-melotti
      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 lifeend of life3.11only security fixesonly security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions

        You are visitor 01402503 — GeezerVison does not store the pages you look up.
        Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.