Re: Mutable Bytes

"Mark Hahn" <[email protected]> Mon, 26 Jul 2004 21:57:14 -0700
Newsgroups gmane.comp.lang.prothon.user
Message-ID <[email protected]>
Mark Hahn wrote:
> Greg Ewing wrote:
>
>>> Every function is copied before it is called
>>
>> Pardon? Why is that necessary?
>
> Even before I decided to store the local vars in the function
> attributes, I ran into trouble having only one function object for
> all running copies early on.  I can't find the messages in the
> archives but I had to do the copy to get normal Python-like behavior.
> I remember someone complaining and my adding the copy.  Now you've
> got me curious.  I'll keep looking.

OK, once again my brain was malfunctioning.  It was when the def keyword was
executed that a copy of the function was made, not when it was called.  The
problem had something to do with executing the def more than once.

This calls into question the whole idea of using a copy of the function for
the scope object.  I'll pull that from my talk.