[Tutor] instance method call issue
Steven D'Aprano
steve at pearwood.info
Sun Oct 21 11:47:39 CEST 2012
Digging up a week-old email from Bob:
On 15/10/12 08:37, bob gailer wrote:
> On 10/14/2012 8:34 AM, Osemeka Osuagwu wrote:
>> except:
>> print 'Cannot display Grid'
>
> In addition to Steve's comment I add my own gripe:
>
> When delivering an error message tell us WHY. I have seen too many
> messages "cannot do xxx" with no information that might help me
>debug.
> "cannot load file xxx"
> "Windows cannot load the installer for xxx"
>
> or totally confusing messages
> "error 6 trying to report error 6"
> "cannot do xxx to file yyy. file exists"
>
> In reality the underlying program knows a lot more about why. Could
>not the developers have presented that information as well?
Of course they can, and I always try to write good, helpful error
messages. Sometimes I fail :)
Here is a random selection of some of my exceptions, taken entirely
out of context:
ValueError('error tolerances must be non-negative')
StatsError('geometric mean of negative number')
InvalidNumber("Invalid TFN, checkdigit does not match.")
ValueError('output file already exists')
TypeError('frange expects 1-4 arguments, got %d' % n)
ValueError('step must not be zero')
ValueError('gamma function undefined at 0 and negative integers')
TypeError('expected a namespace but got a %s' % typename)
TypeError('abstract method <%s> must be overridden' % func.__name__)
And then there's this one...
ValueError("broken")
O_o
--
Steven
More information about the Tutor
mailing list