gett error message: "TypeError: 'int' object is not callable"

J. Cliff Dyer jcd at sdf.lonestar.org
Fri Jul 10 20:59:29 CEST 2009


On Thu, 2009-07-09 at 13:53 +0000, Friðrik Már Jónsson wrote:
> Look at:
> 
>    len = len(text)
> 
> You're overriding `len` (a built-in method), with an integer  
> (`len(text)`).  You then call:
> 
>    for i in range(len(fields)):
> 
> But `len` is no longer a callable, but merely an integer.
> 
> Regards,
> Friðrik Már
> 
> P.S. While this is a fairly obvious problem it's usually a good idea  
> to post working code and a traceback when requesting help.

While we're on the subject of good question posting form:  The body of
your post should contain all relevant information.  Please don't make
readers look back at the subject heading for the statement of the
problem.  Duplicating the statement of the problem in the subject and
the body is ok, but it really ought to be in the body.




More information about the Python-list mailing list