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

Make enum.py pep8 compliant #73289

Closed
realitix mannequin opened this issue Dec 29, 2016 · 6 comments
Closed

Make enum.py pep8 compliant #73289

realitix mannequin opened this issue Dec 29, 2016 · 6 comments
Labels
3.7 (EOL) end of life stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@realitix
Copy link
Mannequin

realitix mannequin commented Dec 29, 2016

BPO 29103
Nosy @warsaw, @rhettinger, @bitdancer, @ethanfurman, @realitix
Files
  • enum_format.patch: Patch to fix enum.py
  • 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 2016-12-30.05:19:15.680>
    created_at = <Date 2016-12-29.07:37:30.605>
    labels = ['3.7', 'type-feature', 'library']
    title = 'Make enum.py pep8 compliant'
    updated_at = <Date 2016-12-30.18:22:40.596>
    user = 'https://github.com/realitix'

    bugs.python.org fields:

    activity = <Date 2016-12-30.18:22:40.596>
    actor = 'ethan.furman'
    assignee = 'none'
    closed = True
    closed_date = <Date 2016-12-30.05:19:15.680>
    closer = 'rhettinger'
    components = ['Library (Lib)']
    creation = <Date 2016-12-29.07:37:30.605>
    creator = 'realitix'
    dependencies = []
    files = ['46071']
    hgrepos = []
    issue_num = 29103
    keywords = ['patch']
    message_count = 6.0
    messages = ['284234', '284267', '284308', '284317', '284319', '284337']
    nosy_count = 7.0
    nosy_names = ['barry', 'rhettinger', 'r.david.murray', 'eli.bendersky', 'ethan.furman', 'python-dev', 'realitix']
    pr_nums = []
    priority = 'normal'
    resolution = 'rejected'
    stage = None
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue29103'
    versions = ['Python 3.7']

    @realitix
    Copy link
    Mannequin Author

    realitix mannequin commented Dec 29, 2016

    Hello,
    This is my first patch on CPython, so please tell me if I do something wrong.

    When executing flake8 on Lib/enum.py, there are lot of warning. This patch remove all these warnings.

    @realitix realitix mannequin added 3.7 (EOL) end of life stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Dec 29, 2016
    @bitdancer
    Copy link
    Member

    In general we do not accept PEP-8 patches; it is code churn with insufficient benefit since many modules in the stdlib predate either PEP-8 itself or the current version of PEP-8. However, enum is a new enough module that I suppose this might get accepted. In any case, thank you for wanting to contribute!

    @rhettinger
    Copy link
    Contributor

    I really don't like how this patch is done or even the spirit of it. To my eyes, some of the code looks worse (especially the addition of trailing backslashes and some odd line-wraps that aren't sensitive to readability or context).

    I'm going to close this. If Ethan wants to make minor tweaks to his whitespace or line-wrapping, I believe he can do a better job with his own code.

    Jean-Sebastien, thank you for trying to contribute, but PEP-8ing other people's code generally isn't helpful. I recommend that you find a tracker item that needs a patch for a substantive change and work on that. I think you will find it more satisfying and will have a much greater chance of acceptance.

    @realitix
    Copy link
    Mannequin Author

    realitix mannequin commented Dec 30, 2016

    Hello Raymond Hettinger,
    Thanks for your advice and your comment.

    I agree with you that PEP-8 compliant isn't useful. If you look at my patch, the first change is a unused import, not just a text formatting.

    Maybe this first change can be useful ? (not importing unused module)

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Dec 30, 2016

    New changeset bf6987b93358 by Raymond Hettinger in branch '3.6':
    Issue bpo-29103: Remove unused import. Noticed by Jean-Sebastien Bevilacqua.
    https://hg.python.org/cpython/rev/bf6987b93358

    @ethanfurman
    Copy link
    Member

    Thanks Raymond and Jean-Sebastien.

    @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.7 (EOL) end of life stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants