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

Fix punctuation in isinstance() error message #88806

Closed
wyz23x2 mannequin opened this issue Jul 14, 2021 · 6 comments
Closed

Fix punctuation in isinstance() error message #88806

wyz23x2 mannequin opened this issue Jul 14, 2021 · 6 comments
Labels
3.9 only security fixes 3.10 only security fixes 3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@wyz23x2
Copy link
Mannequin

wyz23x2 mannequin commented Jul 14, 2021

BPO 44640
Nosy @ambv, @pablogsal, @miss-islington, @wyz23x2, @jdevries3133
PRs
  • bpo-44640: Improve punctuation in isinstance() error message #27144
  • [3.10] bpo-44640: Improve punctuation consistency in isinstance/issubclass error messages (GH-27144) #28436
  • 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-09-19.19:31:14.561>
    created_at = <Date 2021-07-14.17:40:20.209>
    labels = ['interpreter-core', 'type-bug', '3.9', '3.10', '3.11']
    title = 'Fix punctuation in isinstance() error message'
    updated_at = <Date 2021-10-04.19:18:42.710>
    user = 'https://github.com/wyz23x2'

    bugs.python.org fields:

    activity = <Date 2021-10-04.19:18:42.710>
    actor = 'pablogsal'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-09-19.19:31:14.561>
    closer = 'pablogsal'
    components = ['Interpreter Core']
    creation = <Date 2021-07-14.17:40:20.209>
    creator = 'wyz23x2'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 44640
    keywords = ['patch']
    message_count = 6.0
    messages = ['397499', '397501', '397502', '402110', '402163', '403160']
    nosy_count = 5.0
    nosy_names = ['lukasz.langa', 'pablogsal', 'miss-islington', 'wyz23x2', 'jack__d']
    pr_nums = ['27144', '28436']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue44640'
    versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

    @wyz23x2
    Copy link
    Mannequin Author

    wyz23x2 mannequin commented Jul 14, 2021

    >>> isinstance(2, 1)
    Traceback (most recent call last):
      ...
    TypeError: isinstance() arg 2 must be a type, a tuple of types or a union
    >>> issubclass(int, 1)
    Traceback (most recent call last):
      ..
    TypeError: issubclass() arg 2 must be a class, a tuple of classes, or a union.
    1. It should be "an union", not "a union".
    2. The punctuation marks aren't the same -- there's a comma before "or" in issubclass, but not isinstance(). And issubclass()'s ends with a period, which isn't the same with other builtins' messages.

    @wyz23x2 wyz23x2 mannequin added 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels Jul 14, 2021
    @jdevries3133
    Copy link
    Mannequin

    jdevries3133 mannequin commented Jul 14, 2021

    The current string is correct. The word "union" is actually an exception to the "a/an" rule. Here is more detail:

    https://english.stackexchange.com/questions/266309/why-is-union-an-exception-to-the-a-an-rule

    @wyz23x2
    Copy link
    Mannequin Author

    wyz23x2 mannequin commented Jul 14, 2021

    Changed to only 2).

    @wyz23x2 wyz23x2 mannequin changed the title Typos in error messages of isinstance() & issubclass() Fix punctuation in isinstance() error message Jul 16, 2021
    @wyz23x2 wyz23x2 mannequin changed the title Typos in error messages of isinstance() & issubclass() Fix punctuation in isinstance() error message Jul 16, 2021
    @ambv
    Copy link
    Contributor

    ambv commented Sep 17, 2021

    New changeset f481338 by wyz23x2 in branch 'main':
    bpo-44640: Improve punctuation consistency in isinstance/issubclass error messages (GH-27144)
    f481338

    @pablogsal
    Copy link
    Member

    New changeset 9c23a1e by Miss Islington (bot) in branch '3.10':
    bpo-44640: Improve punctuation consistency in isinstance/issubclass error messages (GH-27144) (GH-28436)
    9c23a1e

    @pablogsal
    Copy link
    Member

    New changeset 39c4fe5 by Pablo Galindo (Miss Islington (bot)) in branch '3.10':
    bpo-44640: Improve punctuation consistency in isinstance/issubclass error messages (GH-27144) (GH-28436)
    39c4fe5

    @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.9 only security fixes 3.10 only security fixes 3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants