annotate python/example/deldel.py @ 780:c1ab43edf296
https://docs.python.org/3.1/distutils/uploading.html#pypi-package-display
| author |
Jeff Hammel <k0scist@gmail.com> |
| date |
Tue, 23 Aug 2016 15:01:41 -0700 |
| parents |
d6f535ef4bdc |
| children |
|
| rev |
line source |
|
500
|
1 #!/usr/bin/env python
|
|
|
2
|
|
|
3 class Foo(object):
|
|
|
4 def __call__(self, string):
|
|
|
5 print string
|
|
|
6 def __del__(self):
|
|
|
7 print "Deleting"
|
|
|
8
|
|
|
9 foo = Foo()
|
|
|
10 foo("You will see deleting")
|
|
|
11 del foo
|
|
|
12
|
|
|
13 foo = Foo()
|
|
|
14 del Foo.__del__
|
|
|
15 foo("And now you won't")
|
|
|
16 del foo
|