python / cpython

The Python programming language
https://www.python.org
Other
63.04k stars 30.19k forks source link

Improve usage of PEP8 in Docs/includes/* #56138

Closed sandrotosi closed 13 years ago

sandrotosi commented 13 years ago
BPO 11929
Nosy @rhettinger, @abalkin, @sandrotosi
Files
  • pep8_doc_includes.patch
  • 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: ```python assignee = 'https://github.com/rhettinger' closed_at = created_at = labels = ['docs'] title = 'Improve usage of PEP8 in Docs/includes/*' updated_at = user = 'https://github.com/sandrotosi' ``` bugs.python.org fields: ```python activity = actor = 'python-dev' assignee = 'rhettinger' closed = True closed_date = closer = 'rhettinger' components = ['Documentation'] creation = creator = 'sandro.tosi' dependencies = [] files = ['21784'] hgrepos = [] issue_num = 11929 keywords = ['patch'] message_count = 7.0 messages = ['134486', '134487', '134488', '134490', '134492', '134498', '134499'] nosy_count = 5.0 nosy_names = ['rhettinger', 'belopolsky', 'sandro.tosi', 'docs@python', 'python-dev'] pr_nums = [] priority = 'low' resolution = 'fixed' stage = 'patch review' status = 'closed' superseder = None type = None url = 'https://bugs.python.org/issue11929' versions = ['Python 3.3'] ```

    sandrotosi commented 13 years ago

    Following up http://mail.python.org/pipermail/docs/2011-April/004032.html I made a run of PEP-8 on Doc/includes/ py files.

    i've prepared a patch against default; if it's considered worth I can prepare patches for the other branches (for sure 2.7 needs a different patch, and probably also 3.1).

    rhettinger commented 13 years ago

    IMO, this is a complete waste of time and much of the code doesn't actually read any better afterwards. Some of the mathematical expressions look worse.

    There may be some merit to splitting the imports but that isn't worth much either, perhaps not enough to warrant trouncing the version control history on those lines.

    abalkin commented 13 years ago

    Another -1 from me. Similar changes to inline examples in the docs have been rejected in the past for the same reasons as Raymond wrote. See bpo-4649.

    abalkin commented 13 years ago

    On the other hand, I would be +0 for the tzinfo-examples fixes of the form:

    foo(x=default) vs. foo(x = default)

    (This was also the fix suggested on the ML.)

    Overall, I think it is good to judicially point out to PEP-8 violations where fixes would improve readability, but mechanical reformatting is likely to be net loss. I may fix tzinfo-examples next time I touch it. With addition of timezone class in 3.3, this set of examples needs to be updated.

    rhettinger commented 13 years ago

    foo(x=default) vs. foo(x = default)

    That's fine. Most of the rest of it isn't.

    rhettinger commented 13 years ago

    I put a few of these in (ones where it looked like readability was improved).

    1762cc99-3127-4a62-9baf-30c3d0f51ef7 commented 13 years ago

    New changeset 5e93c5cdc378 by Raymond Hettinger in branch '3.2': bpo-11929: Minor whitespace clean-ups. http://hg.python.org/cpython/rev/5e93c5cdc378

    New changeset 89fcadbc49df by Raymond Hettinger in branch 'default': bpo-11929: Minor whitespace clean-ups. http://hg.python.org/cpython/rev/89fcadbc49df