Re: style: single and multiple lines

2017-10-02 Thread Rhodri James
On 02/10/17 17:00, Stefan Ram wrote: My copy of pep 8 (from 2016) says: Yes: def f(x): return 2*x . So this single-line style should not be that bad. However, I remember someone saying that the multiline style is more phytonic? So, is this better: def f(x): return 2*x

Re: style: single and multiple lines

2017-10-02 Thread Steve D'Aprano
On Tue, 3 Oct 2017 03:00 am, Stefan Ram wrote: > My copy of pep 8 (from 2016) says: Why don't you look at the current version, which is conveniently available to anyone on the internet, for free? https://www.python.org/dev/peps/pep-0008/‎ (Last commit to the PEP was Jul 12, 2017.) >

Re: style: single and multiple lines

2017-10-02 Thread Marko Rauhamaa
r...@zedat.fu-berlin.de (Stefan Ram): > def f(x): return 2*x > > . So this single-line style should not be that bad. I very rarely allow myself to write single-line complex statements. It is usually when defining exceptions: class SyntaxError(Exception): pass if even then. > def f(x): >