Re: "None" and "pass"

2018-02-06 Thread Rhodri James
On 06/02/18 10:23, alister via Python-list wrote: On Tue, 06 Feb 2018 08:55:35 +1100, Chris Angelico wrote: On Tue, Feb 6, 2018 at 8:39 AM, Ben Finney wrote: Chris Angelico writes: As one special case, I would accept this sort of code: def f(): ... (three dots representing the speci

Re: "None" and "pass"

2018-02-06 Thread alister via Python-list
On Tue, 06 Feb 2018 08:55:35 +1100, Chris Angelico wrote: > On Tue, Feb 6, 2018 at 8:39 AM, Ben Finney > wrote: >> Chris Angelico writes: >> >>> As one special case, I would accept this sort of code: >>> >>> def f(): >>> ... >>> >>> (three dots representing the special value Ellipsis) >>> >>

Re: "None" and "pass"

2018-02-05 Thread Chris Angelico
On Tue, Feb 6, 2018 at 8:39 AM, Ben Finney wrote: > Chris Angelico writes: > >> As one special case, I would accept this sort of code: >> >> def f(): >> ... >> >> (three dots representing the special value Ellipsis) >> >> It's a great short-hand for "stub". > > I would not accept that. > > An

Re: "None" and "pass"

2018-02-05 Thread Ben Finney
Chris Angelico writes: > As one special case, I would accept this sort of code: > > def f(): > ... > > (three dots representing the special value Ellipsis) > > It's a great short-hand for "stub". I would not accept that. An even better way to write a stub function is to write a docstring:

Re: "None" and "pass"

2018-02-05 Thread Chris Angelico
On Tue, Feb 6, 2018 at 6:47 AM, Alain Ketterlin wrote: > r...@zedat.fu-berlin.de (Stefan Ram) writes: > >> A participant of my Python course asked whether one could >> also use "None" instead of "pass". What do you think? >> >> def f(): >> pass >> >> can also be written as >> >> def f():

Re: "None" and "pass"

2018-02-05 Thread Alain Ketterlin
r...@zedat.fu-berlin.de (Stefan Ram) writes: > A participant of my Python course asked whether one could > also use "None" instead of "pass". What do you think? > > def f(): > pass > > can also be written as > > def f(): > None > > . Is there any place where "None" could not be use