[issue18472] Update PEP 8 to encourage modern conventions

2014-04-28 Thread Florent Xicluna
Changes by Florent Xicluna : -- nosy: +flox ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue18472] Update PEP 8 to encourage modern conventions

2013-08-05 Thread R. David Murray
R. David Murray added the comment: Technically a bytes object is sequence of integers, not a sequence of bytes. That is, if you iterate it, you get integers. Python doesn't have a 'byte' type. -- nosy: +r.david.murray ___ Python tracker

[issue18472] Update PEP 8 to encourage modern conventions

2013-08-05 Thread Terry J. Reedy
Terry J. Reedy added the comment: Ezio 2. Explicitly say "use 'as' instead of ','". Someone who does not know that 'as' is available since 2.6 may not understand. 3. 'byte' may be interpreted as 'char', especially for someone using 2.x 'bytes'. --

[issue18472] Update PEP 8 to encourage modern conventions

2013-08-05 Thread Ezio Melotti
Ezio Melotti added the comment: I'm a bit late but I still have a few comments: + The paren-using form also means that when the exception arguments are + long or include string formatting, you don't need to use line + continuation characters thanks to the containing parentheses. This paragra

[issue18472] Update PEP 8 to encourage modern conventions

2013-08-02 Thread Guido van Rossum
Guido van Rossum added the comment: Sorry, I forgot the push. I had to do a little merge dance and also fixed one typo (a redundant 'line') and now it's hopefully pushed. -- ___ Python tracker

[issue18472] Update PEP 8 to encourage modern conventions

2013-08-02 Thread Nick Coghlan
Nick Coghlan added the comment: I applied Guido's update in http://hg.python.org/peps/rev/82e24ac40255 I'm not sure what happened with Guido's "Patch applied" above, but I wanted to include Terry's encoding fixes from #18628, so I figured it made sense to ensure this was included first. -

[issue18472] Update PEP 8 to encourage modern conventions

2013-08-02 Thread Nick Coghlan
Nick Coghlan added the comment: I like the new wording, but was there a missing "hg push" here? (Not seeing the update on hg.python.org/peps) -- ___ Python tracker ___ __

[issue18472] Update PEP 8 to encourage modern conventions

2013-08-01 Thread Guido van Rossum
Guido van Rossum added the comment: Patch applied. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue18472] Update PEP 8 to encourage modern conventions

2013-08-01 Thread Tshepang Lekhonkhobe
Tshepang Lekhonkhobe added the comment: @Guido am glad for the patch; it's a nice compromise -- ___ Python tracker ___ ___ Python-bugs

[issue18472] Update PEP 8 to encourage modern conventions

2013-08-01 Thread Tshepang Lekhonkhobe
Changes by Tshepang Lekhonkhobe : -- nosy: +tshepang ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue18472] Update PEP 8 to encourage modern conventions

2013-08-01 Thread Guido van Rossum
Guido van Rossum added the comment: See proposed patch at https://codereview.appspot.com/12269044/ . -- ___ Python tracker ___ ___ Pyt

[issue18472] Update PEP 8 to encourage modern conventions

2013-08-01 Thread Guido van Rossum
Guido van Rossum added the comment: I think the current wording about line length makes it too easy to adopt 99 instead of 79. I propose to go back to 79 only, and add this before the paragraph starting with "The preferred way of wrapping long lines ..." """ Some teams strongly prefer a longe

[issue18472] Update PEP 8 to encourage modern conventions

2013-08-01 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks a bundle, Nick! -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue18472] Update PEP 8 to encourage modern conventions

2013-08-01 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Aug 01, 2013, at 12:19 PM, Nick Coghlan wrote: >I *didn't* make any changes in relation to Barry's comment about having the >commentary intermixed with the guidelines. I quite like the notion of >stripping PEP 8 down to just the essentials and having PEP 108

[issue18472] Update PEP 8 to encourage modern conventions

2013-08-01 Thread Nick Coghlan
Nick Coghlan added the comment: Heh, I just realised a correct generator definition would have needed the loop-and-a-half internally anyway: def itervalues(x): while True: value = x.getvalue() if not value: break yield value -- _

[issue18472] Update PEP 8 to encourage modern conventions

2013-08-01 Thread Nick Coghlan
Changes by Nick Coghlan : -- resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker ___ ___ Pyt

[issue18472] Update PEP 8 to encourage modern conventions

2013-08-01 Thread Nick Coghlan
Nick Coghlan added the comment: For the record, the thread where Thomas Wouters provided the feedback that led to the current wording regarding imports: http://mail.python.org/pipermail/python-dev/2013-July/127373.html -- ___ Python tracker

[issue18472] Update PEP 8 to encourage modern conventions

2013-08-01 Thread Nick Coghlan
Nick Coghlan added the comment: Changes in version 5: - added a new reference pointing back to this tracker issue. I figure that's a good precedent to set for future updates. - I liked Barry's point about "Don't break backwards compatility" enough that I moved it into its own paragraph ahead o

[issue18472] Update PEP 8 to encourage modern conventions

2013-07-29 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue18472] Update PEP 8 to encourage modern conventions

2013-07-29 Thread Guido van Rossum
Guido van Rossum added the comment: [Guido] >>- Regarding line length, I think it is reasonable to mention that many >>- organizations are settling on 100 as a compromise. On newer laptops you >>- can still fit two terminal windows (with a reasonable font size) side by >>- side. (Also many peop

[issue18472] Update PEP 8 to encourage modern conventions

2013-07-29 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Jul 28, 2013, at 04:59 AM, Raymond Hettinger wrote: >- Regarding line length, I think it is reasonable to mention that many >organizations are settling on 100 as a compromise. On newer laptops you >can still fit two terminal windows (with a reasonable font

[issue18472] Update PEP 8 to encourage modern conventions

2013-07-29 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Jul 28, 2013, at 09:48 PM, Nick Coghlan wrote: > >Nick Coghlan added the comment: > >"with statements are good", basically. `with ExitStack() as stack` is even better :) -- ___ Python tracker

[issue18472] Update PEP 8 to encourage modern conventions

2013-07-29 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Jul 27, 2013, at 03:13 PM, Guido van Rossum wrote: >- I think we should recommend against tabs outright. They are getting more >- and more misunderstood. +1 >- Regarding line length, I think it is reasonable to mention that many >- organizations are settl

[issue18472] Update PEP 8 to encourage modern conventions

2013-07-29 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: Comments on the diff. > -Two good reasons to break a particular rule: > +Some especially good reasons to ignore a particular guideline: It's probably enough to just s/Two/Some/ - not sure the 'especially' emphasis is really needed. > +3. Because the code in q

[issue18472] Update PEP 8 to encourage modern conventions

2013-07-28 Thread Guido van Rossum
Guido van Rossum added the comment: > Raymond Hettinger added the comment: > > Nick, +1 from me if you want to make your edits and wrap this one up. +1 from me too. -- ___ Python tracker __

[issue18472] Update PEP 8 to encourage modern conventions

2013-07-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: Nick, +1 from me if you want to make your edits and wrap this one up. -- ___ Python tracker ___ _

[issue18472] Update PEP 8 to encourage modern conventions

2013-07-28 Thread Nick Coghlan
Nick Coghlan added the comment: "with statements are good", basically. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue18472] Update PEP 8 to encourage modern conventions

2013-07-28 Thread Guido van Rossum
Guido van Rossum added the comment: OK, forget I said anything about exceptions. The language in Nick's patch is fine. Regarding "break is bad", while I agree with Terry's recommendation, I think saying anything about this would be overreaching the scope of a style guide. We shouldn't give

[issue18472] Update PEP 8 to encourage modern conventions

2013-07-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Based on recent python-list posts, there is also 'break is bad' propaganda > going around. Perhaps we should say that loop-and-a-half with break is > preferred (or at least equally acceptable) to repeating code. Sometimes yet one alternative can be used in

[issue18472] Update PEP 8 to encourage modern conventions

2013-07-28 Thread Terry J. Reedy
Terry J. Reedy added the comment: Based on recent python-list posts, there is also 'break is bad' propaganda going around. Perhaps we should say that loop-and-a-half with break is preferred (or at least equally acceptable) to repeating code. while True: value = getvalue() if not value:

[issue18472] Update PEP 8 to encourage modern conventions

2013-07-27 Thread Nick Coghlan
Nick Coghlan added the comment: The exception one is near-and-dear to my heart at the moment, as we're in the process of refactoring a large app that currently does various checks in the UI layer so it can present nice errors, when it should really be leaving those checks to the business logic la

[issue18472] Update PEP 8 to encourage modern conventions

2013-07-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: - I think we should recommend against tabs outright. They are getting more and more misunderstood. +1 Perhaps also mention that Python 3 now raises TabError for inconsistent tabs and spaces. - Regarding line length, I think it is reasonable to mention t

[issue18472] Update PEP 8 to encourage modern conventions

2013-07-27 Thread Guido van Rossum
Guido van Rossum added the comment: This is mostly fine. FWIW I disagree with MAL's assertion that we need to start adding internal versioning; people who "lawyer" about which version of the PEP should apply are focused on the wrong thing entirely. IIUC the occasional Python-3-specific rule

[issue18472] Update PEP 8 to encourage modern conventions

2013-07-27 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: > 1. Added an intro paragraph that makes it clear this is a living document, > not "set and forget". If we want to make this a living document, I think the PEP will have to receive its own internal version number and a history section at the end explaining

[issue18472] Update PEP 8 to encourage modern conventions

2013-07-26 Thread Nick Coghlan
Nick Coghlan added the comment: Guido, if you have time to review these proposed PEP 8 changes, that would be great. Most should be unobjectionable, but I seem to recall you disliking the recommendation for third party function annotation experiments to use an explicit decorator, so I'm happy

[issue18472] Update PEP 8 to encourage modern conventions

2013-07-26 Thread Nick Coghlan
Changes by Nick Coghlan : -- nosy: +gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue18472] Update PEP 8 to encourage modern conventions

2013-07-26 Thread Nick Coghlan
Changes by Nick Coghlan : Removed file: http://bugs.python.org/file30936/issue18472_pep_8_update.diff ___ Python tracker ___ ___ Python-bugs-l

[issue18472] Update PEP 8 to encourage modern conventions

2013-07-26 Thread Nick Coghlan
Changes by Nick Coghlan : Removed file: http://bugs.python.org/file30938/issue18472_pep_8_update3.diff ___ Python tracker ___ ___ Python-bugs-

[issue18472] Update PEP 8 to encourage modern conventions

2013-07-26 Thread Nick Coghlan
Changes by Nick Coghlan : Removed file: http://bugs.python.org/file30937/issue18472_pep_8_update2.diff ___ Python tracker ___ ___ Python-bugs-

[issue18472] Update PEP 8 to encourage modern conventions

2013-07-26 Thread Nick Coghlan
Nick Coghlan added the comment: Latest version is a more general cleanup patch for PEP 8 (hence the change in the issue title). Enumerating all the changes/additions: 1. Added an intro paragraph that makes it clear this is a living document, not "set and forget". 2. Added a couple more explic

[issue18472] Update PEP 8 to encourage modern conventions

2013-07-26 Thread Nick Coghlan
Changes by Nick Coghlan : -- assignee: -> ncoghlan title: PEP 8 updates - internal interfaces and import * -> Update PEP 8 to encourage modern conventions ___ Python tracker __