On 2015-11-18, Ian Kelly <[email protected]> wrote:
> On Wed, Nov 18, 2015 at 2:08 PM, fl <[email protected]> wrote:
>> def eList(val, list0=[]):
> The list0 parameter has a default value, which is [], an initially
> empty list. The default value is evaluated when the function is
> defined, not when it is called, so the same list object is used each
> time and changes to the list are consequently retained between calls.
One might consider this a way to have a local varible inside a
function that's "static" a-la C. However, one probably oughtn't.
--
Grant Edwards grant.b.edwards Yow! Gibble, Gobble, we
at ACCEPT YOU ...
gmail.com
--
https://mail.python.org/mailman/listinfo/python-list