The most annoying typo error...

Marcus Alanen marcus at infa.abo.fi
Wed May 7 16:59:42 EDT 2003


On 7 May 2003 01:00:58 -0700, Peter Ballard <pballard at ozemail.com.au>
wrote:

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

Hi, I've had the same problem myself quite extensively. The only
"solution" I came up with, but which actually helped, was practise,
practice, practise. ;)

It's not particularly _good_ advice. I still do lot's of completely
trivial typing errors, usually related to variable names and/or
namespaces. Worse, I _find_ these kinds of errors now and then from
our code. (This naturally suggests that we should do more & better
unittests, assertion checks etc.)

But I agree, it is annoying: how many of you noticed I spelled both
"practice" and "practise" above? ;-)

Marcus




More information about the Python-list mailing list