Problem with assigning variables of type List

Fredrik Lundh fredrik at pythonware.com
Wed Aug 21 11:17:17 EDT 2002


Paul Foley wrote:

> Fine, let's see what FOLDOC has to say, shall we? :-

did you look "reference" up in foldoc?

>   CALL-BY-VALUE:
>
>   (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. See applicative order reduction, call-by-value-result,
>   strict evaluation, call-by-name, lazy evaluation.
>
> So: arguments are evaluated before the function or procedure is
> entered?  Yup, Python does that.  Only the values are passed, and
> changes to the arguments within the called procedure have no effect on
> the actual arguments as seen by the caller?

perhaps if you're using your own, very precise and extremely narrow
definitions of words like "value", "argument", "change", "procedure" etc.

but in the real world, it's more like this:

    def reality_check(sentence):
        # try to change my argument
        sentence[3:] = ["big", "fucking", "idiot"]

    description = ["paul", "foley", "is", "a", "genius"]
    reality_check(description)
    for word in description: print word,

> Wrong again.

do you have any evidence that your I-have-a-big-stick-up-my-ass
approach has ever helped you explain anything to anyone?

</F>





More information about the Python-list mailing list