Greg Ewing wrote: > Xavier Morel wrote: > >> I fail to grasp the unpredictability of "the last expression >> evaluated in the body of a function is its return value". > > It's unpredictable in the sense that if you're writing > a function that's not intended to return a value, you're > not thinking about what the last call you make in the > function returns, so to a first approximation it's just > some random value. > > I often write code that makes use of the fact that falling > off the end of a function returns None. This has been a > documented part of the Python language from the beginning, > and changing it would break a lot of code for no good > reason. It also means adding a debugging message, assertion, or otherwise side-effect free statement can change the return value of the function. Not cool. Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia ---------------------------------------------------------------
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4