Huh? func_defaults, default values in function calls

Fredrik Lundh effbot at telia.com
Tue Apr 11 10:30:17 EDT 2000


James "Wez" Weatherall wrote:
> You won't get this behaviour with something like:
>
> def myfun(x, a = 5):
>     a = x
>
> though, I don't think, because "5" isn't mutable.

footnote: that has nothing to do with mutability.  in
the following example, the list isn't modified either:

    def myfun(x, a = []):
        a = x

</F>





More information about the Python-list mailing list