Revision 1 as of 2006-02-02 07:08:14

Clear message

Note : This is an experimental page, Python can be learned interactively from a prompt, and learning by observations is a good habit, so this page. -- BaijuMuthukadan

(This page is not linked from main pages yet.)

__del__ workings

   1 >>> class C:
   2 ...     def __del__(self):
   3 ...             print "HI"
   4 ... 
   5 >>> c=C()
   6 >>> del(c)
   7 HI
   8 >>> c=C()
   9 >>> c=1
  10 HI
  11 >>> c
  12 1
  13 >>> c=C()
  14 >>> type(c)
  15 <type 'instance'>
  16 >>> c
  17 <__main__.C instance at 0x402328cc>
  18 >>> d=c
  19 >>> c=4
  20 >>> d=7
  21 >>> d
  22 HI
  23 7

Unable to edit the page? See the FrontPage for instructions.