From: Bruce S. <Bru...@nc...> - 2009-09-12 19:07:11
|
None of us readers of this mailing list participated in the creation of Python, so I doubt that anyone here can tell you why Python is built that way, nor argue the merits of the case. Nor was the intent of the experienced.html article to explain this behavior, only to alert you to it. As for utility of this behavior: It's a bit of a stretch for me, but I can imagine a situation where you want to refer to some very long name by using a short name, as in s = the_sphere_whose_outer_surface_represents_Earth = sphere() s.pos = vector(10,20,30) I tried a little googling to find some history and found this laconic comment: "It is not weird in Python. Implicit copies are never made, partly because it's very hard to implement it correctly for every object." Also, http://merd.sourceforge.net/inoutness.html seems to summarize these issues for diverse programming languages. Bruce Sherwood Lenore Horner wrote: > >> http://vpython.org/contents/experienced.html > > I'm sorry to say that it was entirely unenlightening. The only relevant > statement seems to be this "Making a second, independent copy of an > object is a fairly unusual thing to do in Python, but there exist > special methods for doing this." But there is zilch explanation of why > this is so. I repeat: why ever would I want two identical objects that > _must remain so forever_ ? I completely fail to grasp the utility of > this concept. I cannot think of a single thing that I can accomplish > with two identical objects that I cannot accomplish with only one of them. > > Sorry to be so boneheaded about this, but I just don't get it. > > Lenore |