A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2000-August/009010.html below:

[Python-Dev] stack check on Unix: any suggestions?

[Python-Dev] stack check on Unix: any suggestions? [Python-Dev] stack check on Unix: any suggestions?Guido van Rossum guido@beopen.com
Thu, 31 Aug 2000 11:30:48 -0500
> > 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).
> 
> 8192 refers to kB, i.e. 8 MB.
> 
> I get 6053 on SuSE Linux 6.2 without resource stack limit set.
> 
> Strange enough if I put the above inside a script, the class
> isn't instantiated. The recursion only starts when I manually
> trigger C() in interactive mode or do something like
> 'print C()'. Is this a bug or a feature ?

Aha.  I was wrong -- it's happening in repr(), not during
construction.

--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