cptnapalm
September 10th, 2006, 12:50 AM
I was working through Byte of Python (http://swaroopch.info/text/Byte_of_Python:Object_oriented_programming) and started doing the exercise teaching Class and Object variables. While typing I only changed the names used for the variables at the very end.
I used my name, "Patrick", for "Swaroop" and "patrick" for "swaroop".
I then used "David" for "Abdul Kalam" and "dave" for "kalam"
And I get this error when running it: Exception exceptions.AttributeError: "'NoneType' object has no attribute 'population'" in <bound method Person.__del__ of <__main__.Person instance at 0xb7d66c8c>> ignored
But when I change "dave" to "david" everything works just fine.
The result of diff is:
47,48c47,48
< dave = Person('David')
< dave.say_hi()
---
> david = Person('David')
> david.say_hi()
So that is the ONLY difference. But the top one fails and the bottom one succeeds. I am completely confused.
I used my name, "Patrick", for "Swaroop" and "patrick" for "swaroop".
I then used "David" for "Abdul Kalam" and "dave" for "kalam"
And I get this error when running it: Exception exceptions.AttributeError: "'NoneType' object has no attribute 'population'" in <bound method Person.__del__ of <__main__.Person instance at 0xb7d66c8c>> ignored
But when I change "dave" to "david" everything works just fine.
The result of diff is:
47,48c47,48
< dave = Person('David')
< dave.say_hi()
---
> david = Person('David')
> david.say_hi()
So that is the ONLY difference. But the top one fails and the bottom one succeeds. I am completely confused.