simple StackOverflower

Berthold Hoellmann hoel at GermanLloyd.org
Tue Mar 21 10:15:30 EST 2000


Michal Bozon wrote:
> 
> Oooooooops.
> Correction:
> 
>  class StackOverflower:
>      ":-)"
>      def __init__(self):
>          self.__init__()

With 

>python
Python 1.5.2 (#3, Jul  7 1999, 08:48:09) [C] on sunos5
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> >>> class StackOverflower:
...      ":-)"
...      def __init__(self):
...          self.__init__()
... 
>>> a=StackOverflower()

I get:


Traceback (innermost last):
  File "<stdin>", line 4, in __init__
  File "<stdin>", line 4, in __init__
  File "<stdin>", line 4, in __init__
  File "<stdin>", line 4, in __init__
...
  File "<stdin>", line 4, in __init__
  File "<stdin>", line 4, in __init__
  File "<stdin>", line 4, in __init__
  File "<stdin>", line 4, in __init__
  File "<stdin>", line 4, in __init__
RuntimeError: Maximum recursion depth exceeded
>>> 

No stack overflow.


Cheers

Berthold
-- 
email: hoel at GermanLloyd.org
   )
  (
C[_]  These opinions might be mine, but never those of my employer.



More information about the Python-list mailing list