The most annoying typo error...

Dave Harrison dave at nullcube.com
Wed May 7 07:59:16 EDT 2003


I can't claim to be a guru python coder, however I have coded python for about 2 years now.

IMHO this particular prob is a wart (as I had it describe to me when I ran across it by accident).  Now once you know the problem and can recognise it, it is simple enough to avoid.  But is not really an intuitive prob to recognise right away.

Python's strenght is in not ignoring such problems, but with removing them - or so I have always felt.

The solution, I wish I could give one, but parsing is not really my forte (more's the pity I guess).  But finding a solution would be great, if only to save other coders the 12 hours of pain I experienced tracking this prob back in a web app where its not really obvious where the error is originating from.

Cheers
Dave

Peter Hansen (peter at engcorp.com):
> Peter Ballard wrote:
> > 
> > ....Is when I do something like this:
> > 
> > x = somefunction(a, b, c, d),
> > 
> > and when I run Python I get a TypeError error.
> > 
> > You spotted the error immediately didn't you? The line of code above
> > has a trailing comma, so that x is suddenly a tuple; and so when I get
> > around to using x I get a TypeError.
> > 
> > I don't know about anyone else, but for me, this error always takes a
> > long time to track down.
> 
> If you really have this problem frequently enough (or ever?!) to be
> an annoyance, just write a script that checks for it... grep can be
> a handy tool...  in my experience, this is NOT something that most,
> let alone many, programmers make.
> 
> -Peter
> -- 
> http://mail.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list