Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add note to typing.Union that it is recommended to use | instead #90278

Closed
sobolevn opened this issue Dec 18, 2021 · 5 comments
Closed

Add note to typing.Union that it is recommended to use | instead #90278

sobolevn opened this issue Dec 18, 2021 · 5 comments
Labels
3.10 only security fixes 3.11 only security fixes docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error

Comments

@sobolevn
Copy link
Member

BPO 46120
Nosy @gpshead, @asvetlov, @ambv, @miss-islington, @sobolevn, @Fidget-Spinner
PRs
  • bpo-46120: State that | is preferred over Union #30222
  • [3.10] bpo-46120: State that | is preferred over Union (GH-30222) #30250
  • 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-12-29.11:57:14.805>
    created_at = <Date 2021-12-18.08:20:39.434>
    labels = ['3.11', 'type-bug', '3.10', 'docs']
    title = 'Add note to `typing.Union` that it is recommended to use `|` instead'
    updated_at = <Date 2021-12-29.21:33:41.569>
    user = 'https://github.com/sobolevn'

    bugs.python.org fields:

    activity = <Date 2021-12-29.21:33:41.569>
    actor = 'sobolevn'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2021-12-29.11:57:14.805>
    closer = 'AlexWaygood'
    components = ['Documentation']
    creation = <Date 2021-12-18.08:20:39.434>
    creator = 'sobolevn'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 46120
    keywords = ['patch']
    message_count = 5.0
    messages = ['408836', '409158', '409302', '409316', '409328']
    nosy_count = 7.0
    nosy_names = ['gregory.p.smith', 'asvetlov', 'docs@python', 'lukasz.langa', 'miss-islington', 'sobolevn', 'kj']
    pr_nums = ['30222', '30250']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue46120'
    versions = ['Python 3.10', 'Python 3.11']

    @sobolevn
    Copy link
    Member Author

    As discussed in https://mail.python.org/archives/list/typing-sig@python.org/thread/TW5M6XDN7DO346RXMADKBAAGNSZPC4ZQ/

    we could probably stick a huge notice in the typing.Union docs saying | is preferred for readability in most cases, and not deprecate it for now.

    I will send a PR to Union and Optional docs with this note today.

    @sobolevn sobolevn added 3.10 only security fixes 3.11 only security fixes labels Dec 18, 2021
    @sobolevn sobolevn added docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error 3.10 only security fixes 3.11 only security fixes labels Dec 18, 2021
    @sobolevn sobolevn added docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error labels Dec 18, 2021
    @gpshead
    Copy link
    Member

    gpshead commented Dec 24, 2021

    New changeset 1b30660 by Nikita Sobolev in branch 'main':
    bpo-46120: State that | is preferred over Union (GH-30222)
    1b30660

    @miss-islington
    Copy link
    Contributor

    New changeset ed1671c by Miss Islington (bot) in branch '3.10':
    [3.10] bpo-46120: State that | is preferred over Union (GH-30222) (GH-30250)
    ed1671c

    @ambv
    Copy link
    Contributor

    ambv commented Dec 29, 2021

    Haha, that backport took more time than I thought :D

    Thanks! ✨ 🍰 ✨

    @sobolevn
    Copy link
    Member Author

    Thank you for your time, Łukasz!

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.10 only security fixes 3.11 only security fixes docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    5 participants