Re: Funny Python error messages
Peter Hansen wrote: My first one (i'm learning, i'm learning) is TypeError: 'callable-iterator' object is not callable # it = iter(lambda:0, 0) # it() # TypeError: 'callable-iterator' object is not callable Given that the supposed humour depends on the *name* of the object, which is callable-iterator, I'd say it's probably not hard to come up with lots of funny error messages this way. note that will didn't name the type himself. someone callously thought it would be a cool idea to have a non-callable type called callable in python, rather than, say, call it iterator-that-dances-with-callables. /F -- http://mail.python.org/mailman/listinfo/python-list
Re: Funny Python error messages
Peter Hansen wrote: Will Stuyvesant wrote: Perhaps this will even be a useful thread, to brighten the life of the brave people doing the hard work of providing us with error messages. My first one (i'm learning, i'm learning) is TypeError: 'callable-iterator' object is not callable # it = iter(lambda:0, 0) # it() # TypeError: 'callable-iterator' object is not callable Given that the supposed humour depends on the *name* of the object, which is callable-iterator, I'd say it's probably not hard to come up with lots of funny error messages this way. The mildly amusing nature of this error message is due to Will's finding a name, callable-iterator (where callable is a name, not a description), appearing in a different context from where it was coined that causes us to parse it differently (where callable is a description, not a name), and accidentally stating an absurdity. I'd say it's actually a nice bit of subtlety. -- CARL BANKS -- http://mail.python.org/mailman/listinfo/python-list
Re: Funny Python error messages
Will Stuyvesant wrote: Add your funny or surprising Python error messages to this thread. A requirement is that you should also show (minimal) code that produces the message. Put the code below, so people can think about how to generate the message first, a little puzzle if you like. Perhaps this will even be a useful thread, to brighten the life of the brave people doing the hard work of providing us with error messages. I always liked: ValueError: insecure string pickle This error message is not strange if you think of insecure, string and pickle as programming terms, but it's hugely mystifying to someone who isn't a programmer, since all of these words have different meanings in real life. Some code to produce it: import cPickle x = cPickle.dumps([1,2,3,ratsj]) y = x[:18] + ? + x[18:] cPickle.loads(y) Traceback (most recent call last): File input, line 1, in ? ValueError: insecure string pickle -- Hans Nowak http://zephyrfalcon.org/ -- http://mail.python.org/mailman/listinfo/python-list