Andrew Koenig wrote:
"max(01)*" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
is there a way to define a class method which prints the instance name?
The term "the instance name" is misleading, because it assumes, without
saying so explicitly, that every instance has a unique name.
In fact, there is no reason that an instance needs to have a name at all, or
that it should have only one.
You gave this example:
instance_1 = class_1()
instance_1.myName()
but what if I did this instead?
class_1().myName()
Or this?
instance_1 = class_1()
instance_2 = instance_1
instance_2.myName()
excellent points.
i'll get back with proper questions afterwards.
thanks
macs
--
http://mail.python.org/mailman/listinfo/python-list