dmitrey <[EMAIL PROTECTED]> writes: > On Oct 3, 9:46 pm, Bruno Desthuilliers > <[EMAIL PROTECTED]> wrote: > > x = MyClass() > > y = x > > del x > > > > objects = [MyClass() for i in range(100)] > > > > If you can come with a meaningfull answer to "what's *the* name of > > any of the MyClass instance(s)" in both cases, then please let us > > know... > > I had seen the examples during google search, still I hoped for an > answer to my exact situation. I know for sure there will be no > renaming and creating like the above objects = [MyClass() for i in > range(100)].
You *know* this, *for sure*? The only way I can think of that would give you such certain knowledge that such a situation will not happen is an automated, full-coverage unit test suite of all code that uses your class. Which is an excellent position to be in, so I commend you on your diligence. So, why is it that you wish to restrict users of your class to never do such normal operations with instances as in the above examples? What problem are you solving by this restriction? -- \ “Holy human pressure cookers, Batman!” —Robin | `\ | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list