[Tutor] dictionary and more
Steven D'Aprano
steve at pearwood.info
Tue Oct 12 00:47:48 CEST 2010
On Tue, 12 Oct 2010 03:19:22 am Jack Uretsky wrote:
> Hi-
> I apologize for the size of the attached file, but the question
> would make little sense if I made substantial deletions.
> The program gives the following error:
> Traceback (most recent call last):
> File "/Javastuff/python/Glau_Is.py", line 131, in <module>
> Adestin[state]()
> TypeError: 'NoneType' object is not callable
The question makes perfect sense without even looking at the attached
file. Adestin[state] returns None, which you attempt to call as a
function. The questions you should be asking yourself are:
- what value am I expecting it to contain?
- where in my code should that value be set?
- why is it setting None instead?
Armed with these three questions, you now know how to debug the problem
yourself.
--
Steven D'Aprano
More information about the Tutor
mailing list