Finding the instance reference of an object
Terry Reedy
tjreedy at udel.edu
Mon Nov 10 10:30:36 EST 2008
greg wrote:
> Arnaud Delobelle wrote:
>
>> (CBV) An evaluation strategy where arguments are evaluated before
>> the function or procedure is entered. Only the values of the
>> arguments are passed and changes to the arguments within the called
>> procedure have no effect on the actual arguments as seen by the
>> caller.
>
> That hinges on what exactly is meant by "changes to
> the arguments".
Mutating them, like Python does, which is why calling Python CBV leads
people to write buggy code.
>In Python it can only mean assigning
> directly to the bare name -- anything else isn't
> changing the argument itself, but something else to
> which the argument refers.
Hogwash. The argument is the object and mutable objects can be changed
as seen by the caller.
More information about the Python-list
mailing list