> 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/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4