[Python-Dev] PEP 8 modernisation (original) (raw)

Nick Coghlan ncoghlan at gmail.com
Sun Aug 4 04:03:05 CEST 2013


On 4 Aug 2013 11:30, "Alexander Belopolsky" <alexander.belopolsky at gmail.com> wrote:

On Thu, Aug 1, 2013 at 8:44 AM, Nick Coghlan <ncoghlan at gmail.com> wrote: > > 9. Explicit guideline not to assign lambdas to names (use def, that's > what it's for) Would you consider changing the formatting in the recommended example from def f(x): return 2*x to def f(x): return 2*x ?

I consider a single line def acceptable when replacing an equivalent lambda. Restricting it to a single line makes it solely about the spelling of the assignment operation, without any vertical whitespace considerations.

Cheers, Nick.

What is the modern view on single-line def? The "Other Recommendations" section allows but discourages single-line if/for/while, but is silent about def. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20130804/5f1ec6d4/attachment.html>



More information about the Python-Dev mailing list