"len()" gives a curious error

Troy Melhase troy at gci.net
Wed Mar 5 15:34:38 EST 2003


Mike:

The error is caused by this line of code:

> addr, len = string.split(args[0],"/")

You're reassigning the name 'len' to the result of that expression.  The
result is a string, which is why the interpreter gives the error you
mention.

To fix, change the name 'len' to something else.  Good luck.

-troy




More information about the Python-list mailing list