[Python-Dev] stack check on Unix: any suggestions? (original) (raw)
Guido van Rossum guido@beopen.com
Thu, 31 Aug 2000 10:58:49 -0500
- Previous message: [Python-Dev] stack check on Unix: any suggestions?
- Next message: [Python-Dev] stack check on Unix: any suggestions?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Here's a sample script:
i = 0 def foo(x): global i print i i = i + 1 foo(x) foo(None)
Please try this again on various platforms with this version:
i = 0
class C:
def __getattr__(self, name):
global i
print i
i += 1
return self.name # common beginners' mistake
C() # This tries to get __init__, triggering the recursion
I get 5788 iterations on Red Hat Linux 6.2 (ulimit -c says 8192; I have no idea what units).
--Guido van Rossum (home page: http://www.pythonlabs.com/~guido/)
- Previous message: [Python-Dev] stack check on Unix: any suggestions?
- Next message: [Python-Dev] stack check on Unix: any suggestions?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]