On Wed, 12 Sep 2012 03:22:31 -0700 (PDT), pyjoshsys
<j.m.dagenh...@gmail.com> wrote:
The output is still not what I want. Now runtime error free,
however the output is not what I desire.
def setname(cls):
'''this is the proposed generator to call SetName on the
object'''
try:
cls.SetName(cls.__name__)
except Exception as e:
print e
finally:
return cls
I would write the function above in one line:
cls.name = name
class Trial(object):
'''class to demonstrate with'''
def __init__(self):
object.__init__(self)
self.name = None
Remove the line above. The instance attribute self.name is hiding the
class attribute cls.name.
Oscar
--
http://mail.python.org/mailman/listinfo/python-list