Returning none

Jeff Bauer jbauer at rubic.com
Thu Aug 26 18:15:57 CEST 1999


Paul,

I think this proposal would break too much existing
code, even for a Python 2 change.

Arguably, it may not be the best coding style, but I've 
gotten used to functions returning None, if not otherwise
specified.  If your proposal could be guaranteed to 
generate a compile-time error (could it?), it might
encounter less resistance, but I still wouldn't be
very enthusiastic about the idea.  I can appreciate
the issue you're addressing, though.

Best regards,

Jeff Bauer
Rubicon Research

---
Paul Prescod wrote:
> 
> I think it would be more pythonish if this would return a runtime 
> (or even compiletime) error:
> 
> def foo():
>         a=5
> 
> b=foo()
> 
> It shouldn't just return None. That's a source of errors.
> This is obviously an incompatible change so I propose it 
> for Python 2.




More information about the Python-list mailing list