The most annoying typo error...
Peter Hansen
peter at engcorp.com
Wed May 7 07:45:35 EDT 2003
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
More information about the Python-list
mailing list