What is a function parameter =[] for?

Random832 random832 at fastmail.com
Fri Nov 20 09:35:33 EST 2015


On 2015-11-20, BartC <bc at freeuk.com> wrote:
> Finally, a down-to-earth example. Here it probably doesn't matter at 
> what point 'global_database' gets bound. You know it will always refer 
> to the current state of global_database, and you know that it is a data 
> structure external to the function even if it is updated from inside.
>
> That is a bit different from an empty list that later is not empty.

Why is it different? The only difference is that you're thinking of it as "this
particular database" rather than "a database containing this particular data",
but I'd argue you can say the same for the list.




More information about the Python-list mailing list