why is this failing?

Chris Curvey ccurvey at earthlink.net
Thu Sep 11 23:10:29 CEST 2003


I've looked at this so long that I must be looking right past it.  This 
code:

class Page:
     ##########################################################
     def write(self, value, row=None, col=None, len=None):
         print isinstance(value, str)

         # error occurs on this line
         print len(value)

########################################################
if __name__ == "__main__":
     p = Page()

     p.write("banana")



is throwing this error:




True
Traceback (most recent call last):
   File "P2.py", line 13, in ?
     p.write("banana")
   File "P2.py", line 7, in write
     print len(value)
TypeError: 'NoneType' object is not callable


What am I missing?





More information about the Python-list mailing list