Newbies: Re: Returning none
Paul Prescod
paul at prescod.net
Fri Sep 3 00:54:49 EDT 1999
I want to make the empirical point that I brought up this None issue
when two different co-workers ran into the problem in three different
contexts in one statistically unlikely week.
#1. a=list.sort("abc"): "None object has no attribute foo"
#2. alert( print_traceback() ): "None"
#3. Forgetting to return a value.
For experts this is not a big problem. They can diagnose them quickly.
For newbies this is very tricky. Sort is tricky because it defies
intuition and print_traceback() was especially nasty because this works
pretty much as you expect:
print print_traceback()
(at least you see the traceback)
And then you try to put it in a dialog box and all you get is "None".
This is not the nastiest thing in Python but it is (IMO) a real problem.
Paul Prescod
More information about the Python-list
mailing list