Skip to main content
Commonmark migration
Source Link

#Python 2

Python 2

class K(object):
    def __del__(self):
        print "You cannot stop the power of deallocators!"
        K()

This code goes into an infinite loop printing You cannot stop the power of deallocators.

Note that this does not work in Python 3

#Python 2

class K(object):
    def __del__(self):
        print "You cannot stop the power of deallocators!"
        K()

This code goes into an infinite loop printing You cannot stop the power of deallocators.

Note that this does not work in Python 3

Python 2

class K(object):
    def __del__(self):
        print "You cannot stop the power of deallocators!"
        K()

This code goes into an infinite loop printing You cannot stop the power of deallocators.

Note that this does not work in Python 3

Source Link
The Fifth Marshal
  • 6.3k
  • 1
  • 25
  • 44

#Python 2

class K(object):
    def __del__(self):
        print "You cannot stop the power of deallocators!"
        K()

This code goes into an infinite loop printing You cannot stop the power of deallocators.

Note that this does not work in Python 3