10 Jul 2013, 05:01
Avdi-headshot-rep3-2010-square-tight_pragsmall

Avdi Grimm (3 posts)

Reading about how Elixer hides the default accumulator of zero, the first question to pop into my head was “why a separate function instead of a default argument value?” e.g. def sum(list, total // 0) ...

It might be nice to cover the why of that here.

11 Jul 2013, 23:04
Dave_gnome_head_isolated_pragsmall

Dave Thomas (337 posts)

It’s because that would make the initialized value part of the public API. It doesn’t really belong there.

  You must be logged in to comment