A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2009-September/091540.html below:

[Python-Dev] default of returning None hurts performance?

[Python-Dev] default of returning None hurts performance? [Python-Dev] default of returning None hurts performance?Greg Ewing greg.ewing at canterbury.ac.nz
Wed Sep 2 00:04:46 CEST 2009
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.

-- 
Greg
More information about the Python-Dev mailing list

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