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 __repr__ for Tkinter Font objects #86042

Closed
serhiy-storchaka opened this issue Sep 28, 2020 · 5 comments
Closed

Add __repr__ for Tkinter Font objects #86042

serhiy-storchaka opened this issue Sep 28, 2020 · 5 comments
Labels
3.10 only security fixes easy topic-tkinter type-feature A feature request or enhancement

Comments

@serhiy-storchaka
Copy link
Member

BPO 41876
Nosy @serhiy-storchaka, @E-Paine, @diohabara, @p4m-dev
PRs
  • bpo-41876: Overload __repr__ for tkinter Font objects #22450
  • 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 2020-10-14.10:03:12.065>
    created_at = <Date 2020-09-28.15:33:27.932>
    labels = ['easy', 'type-feature', 'expert-tkinter', '3.10']
    title = 'Add __repr__ for Tkinter Font objects'
    updated_at = <Date 2020-10-14.10:03:12.064>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2020-10-14.10:03:12.064>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-10-14.10:03:12.065>
    closer = 'serhiy.storchaka'
    components = ['Tkinter']
    creation = <Date 2020-09-28.15:33:27.932>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 41876
    keywords = ['patch', 'easy']
    message_count = 5.0
    messages = ['377603', '377658', '377660', '377661', '378612']
    nosy_count = 4.0
    nosy_names = ['serhiy.storchaka', 'epaine', 'diohabara', 'platonoff-dev']
    pr_nums = ['22450']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue41876'
    versions = ['Python 3.10']

    @serhiy-storchaka
    Copy link
    Member Author

    Currently Font objects have default repr:

    <tkinter.font.Font object at 0x7fa22c3bd1e0>
    

    Since Font is just an object oriented wrapper for font name, and Font objects with the same name are equal, it is worth to show the font name in the repr and do not show an id.

    <tkinter.font.Font object 'TkDefaultFont'>
    

    @serhiy-storchaka serhiy-storchaka added 3.10 only security fixes topic-tkinter easy type-feature A feature request or enhancement labels Sep 28, 2020
    @diohabara
    Copy link
    Mannequin

    diohabara mannequin commented Sep 29, 2020

    Hi, Storchaka!.
    I would like to tackle this issue.
    Because I am new to Python bug tracking, I am unsure that this is the right approach to bug fixing.

    @E-Paine
    Copy link
    Mannequin

    E-Paine mannequin commented Sep 29, 2020

    Serhiy, while I agree this is an enhancement, I don't see that it would break *anyone's* code (this will mostly just affect the REPL output) so is it worth considering a backport?

    Diohabara, the Python devguide (https://devguide.python.org/) is a very good place to start. The first contribution is always the hardest so please do ask if you need clarification on something. Likely the first thing you will need to do, though, is sign the CLA which means we can legally accept your patch.

    @serhiy-storchaka
    Copy link
    Member Author

    This is a new feature. We do not backport new features to old versions unless they fix some design bug. Nothing bad will happen if we DO NOT backport it.

    @serhiy-storchaka
    Copy link
    Member Author

    New changeset b4d8953 by Anatoliy Platonov in branch 'master':
    bpo-41876: Overload __repr__ for tkinter Font objects (GH-22450)
    b4d8953

    @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 easy topic-tkinter type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant