static variables?
Erik Max Francis
max at alcyone.com
Sat Nov 23 01:11:00 EST 2002
Alex Martelli wrote:
> The semantics of the two mechanisms are very different.
Of course they are.
> Now, these effects (plural) can't BOTH be "the desired effect"
> (singular),
> can they? They're different... so, if one is desired, then the other
> is
> not.
>
> Similarly, it's easy to show differences between using copy and using
> deepcopy as variants of the "copy every time" choice.
I'm really amazed (approaching on exasperated) at the length and
protractedness of this discussion. All I was saying is that it was not
a priori a given that the current implementation was the only
reasonable, efficient, or obvious one. There easily could have been
other choices made, such as the copy.copy (or copy.deepcopy) method I
suggest, or Brian's suggestion of stowing off actual bytecodes, or any
number of other solutions. Would these solutions all be equivalent to
each other? Of course not. Why would they have to be? Different
solutions are different solutions.
These choices weren't made, and I don't think anyone in this thread,
particularly myself, is suggesting that anything be changed. The
"desired effect" (a slightly poor choice of words, since I'm not even
claiming to desire it) I was referring to was simply some well-defined
behavior where default arguments are not persistent objects. There are
many ways this could be done. _If_ one were chosen, then that would be
_the_ behavior, and that would become the standard.
For my original point -- which was simply that a priori the current
behavior was probably not explicitly chosen for any reason other than it
was the easiest to implement -- even the details of any such alternate
implementation are _irrelevant_.
I am not suggesting and have never suggested that such a change be made.
I am not suggesting and have never suggested, if that were the case, how
it should be done. My point was completely lost in the nitpicking about
a three-line code sample I gave to illustrate a completely separate
point.
--
Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
__ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/ \ The more one is hated, I find, the happier one is.
\__/ Louis-Ferdinand Celine
REALpolitik / http://www.realpolitik.com/
Get your own customized newsfeed online in realtime ... for free!
More information about the Python-list
mailing list