What is a function parameter =[] for?

Ian Kelly ian.g.kelly at gmail.com
Thu Nov 19 14:25:21 EST 2015


On Thu, Nov 19, 2015 at 12:19 PM, Chris Angelico <rosuav at gmail.com> wrote:
> But you're
> saying that it "simply substitute[s] the expression", which would mean
> that "func()" is exactly the same as "func(y)". A function default
> argument is therefore able to STEAL STUFF FROM THE CALLER'S SCOPE.
> Sorry for shouting, but if that ain't bizarre, I don't know what is.

It's like pass-by-name, but in reverse.



More information about the Python-list mailing list