why is this failing?

Erik Max Francis max at alcyone.com
Thu Sep 11 17:18:25 EDT 2003


Chris Curvey wrote:

> 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)

You are overriding the name len, so this is equivalent to writing

	None(value)

which is obviously an error.

-- 
   Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
 __ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/  \ God is love, but get it in writing.
\__/  Gypsy Rose Lee




More information about the Python-list mailing list