What is a function parameter =[] for?

Ben Finney ben+python at benfinney.id.au
Wed Nov 18 21:08:45 EST 2015


Chris Angelico <rosuav at gmail.com> writes:

> On Thu, Nov 19, 2015 at 12:41 PM, BartC <bc at freeuk.com> wrote:
> > On 18/11/2015 23:22, Chris Angelico wrote:
> >> On the contrary, it is certain always to be that exact object.
> >
> > But, not the same value that appears as the default?

It depends what you mean by “the same value”.

> Nope. Mutable objects are never guaranteed to retain the same values.
> That's kinda the point.

Well, they are the *same value*, if by “value” you mean “a particular
object”.

On the other hand, the value can *change* over time, while remaining the
same object. So it will not be equal to its initial state, even though
it is the same object.

-- 
 \     “[F]reedom of speech does not entail freedom to have your ideas |
  `\    accepted by governments and incorporated into law and policy.” |
_o__)                                   —Russell Blackford, 2010-03-06 |
Ben Finney




More information about the Python-list mailing list