A Byte of Python - Python Book / Tutorial

midtoad stewart at midtoad.homelinux.org
Sat Mar 6 05:32:43 CET 2004


Swaroop C H wrote:

> I have a written a book on Python which serves as a tutorial or
> guide for anyone who wants to learn Python. It specifically targets
> beginners but experienced programmers can benefit a lot with the
> special notes for them.

Hi Swaroop, I like your use of colour in the examples. It certainly improves
the readability.  I also appreciate your providing the option of reading
the tutorial on-line or, for those on dial-up, the ability to download the
document for off-line reading. 

I have a question about the Object chapter and the use of __del__.  I was
unable to add this method to the objvar.py script without it deleting all
instances of person, not just one.   so, your text:
"Just like the __init__ method, we can also have a __del__ method where we
can decrement the Person.population by 1. This method is run when the
object is no longer in use. If you want to try this out, add the __del__
method and then use the statement del personInstance to delete the object.
You can use a print statement within this method to see when it is run." 
could benefit from having the actual method syntax written out. 

cheers
Stewart





More information about the Python-list mailing list