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

Refactoring the repr() of the _Environ class (os module) #88797

Closed
Leonardofreua mannequin opened this issue Jul 13, 2021 · 3 comments
Closed

Refactoring the repr() of the _Environ class (os module) #88797

Leonardofreua mannequin opened this issue Jul 13, 2021 · 3 comments
Labels
3.11 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@Leonardofreua
Copy link
Mannequin

Leonardofreua mannequin commented Jul 13, 2021

BPO 44631
Nosy @merwok, @ambv, @Leonardofreua
PRs
  • bpo-44631: Make the repr() of the _Environ class more readable. #27128
  • 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-20.17:16:06.483>
    created_at = <Date 2021-07-13.22:04:27.257>
    labels = ['type-feature', 'library', '3.11']
    title = 'Refactoring the repr() of the _Environ class (os module)'
    updated_at = <Date 2021-07-20.17:16:06.483>
    user = 'https://github.com/Leonardofreua'

    bugs.python.org fields:

    activity = <Date 2021-07-20.17:16:06.483>
    actor = 'lukasz.langa'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-07-20.17:16:06.483>
    closer = 'lukasz.langa'
    components = ['Library (Lib)']
    creation = <Date 2021-07-13.22:04:27.257>
    creator = 'Leonardofreua'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 44631
    keywords = ['patch']
    message_count = 3.0
    messages = ['397448', '397647', '397888']
    nosy_count = 3.0
    nosy_names = ['eric.araujo', 'lukasz.langa', 'Leonardofreua']
    pr_nums = ['27128']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue44631'
    versions = ['Python 3.11']

    @Leonardofreua
    Copy link
    Mannequin Author

    Leonardofreua mannequin commented Jul 13, 2021

    Currently, the repr() code of the _Environ class does many things in a bunched way, making it difficult to read and difficult to determine the result returned by the method.

    Therefore, I propose an adjustment in the code to make it more readable, as well as your test.

    @Leonardofreua Leonardofreua mannequin added 3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Jul 13, 2021
    @merwok
    Copy link
    Member

    merwok commented Jul 16, 2021

    Hello! I’ve seen your name on a few recent tickets, thanks for contributing and welcome here!

    In general, the CPython project doesn’t do esthetic code changes for their own sake. Not all code is changed from %-formatting when format is added, not all code using format changes to f-string, and code that works is left alone. Each change merged takes resources to run tests, build packages, update clones; it changes the history of the files touched (which is important when investigating a bug months or years later); it takes time to review (pre or post-commit); it has the opportunity of introducing bugs. Therefore, in the absence of a bug to fix or a new feature that is made easier by prior changes, I think this should be closed as not a bug.

    @merwok merwok removed 3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes 3.10 only security fixes labels Jul 16, 2021
    @ambv
    Copy link
    Contributor

    ambv commented Jul 20, 2021

    New changeset 85fa3b6 by Leonardo Freua in branch 'main':
    bpo-44631: Make the repr() of the _Environ class more readable. (bpo-27128)
    85fa3b6

    @ambv ambv closed this as completed Jul 20, 2021
    @ambv ambv closed this as completed Jul 20, 2021
    @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.11 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants