Tim Peters writes:
| > [tommy]
| > ...
| > Python 1.0.2 (May 4 1994)
| > Copyright 1991-1994 Stichting Mathematisch Centrum, Amsterdam
| > >>> vars()
| > {'__name__': '__main__', '_': {'__name__': '__main__', '_':
| > {'__name__': '__main__', '_': {'__name__': '__main__', '_':
| > {'__name__': '__main__', '_': {'__name__': '__main__', '_':
| > ... endless repetitions
|
| > The output I got was not what I expected. Was this a bug?
|
| Maybe not strictly, but it is a hoot <grin>! The new feature is that '_'
| is automatically set to the result of the last auto-printed expression.
| So I think what's happening is:
|
| 1) vars() returns the namespace N == {'__name__': '__main__'}.
|
| 2) The auto-printer '_' hack binds '_' to N before printing, which
| changes the namespace to N == {'__name__': '__main__, '_': N}.
|
| 3) The attempt to print N == {'__name__': '__main__, '_': N} then falls
| into infinite recursion.
|
| At least that matches the symptoms.
|
| speculatingly y'rs - tim
|
| Tim Peters tim@ksr.com
| not speaking for Kendall Square Research Corp
-------> Tommy.
"Subvert the parental paradigm - Refuse Birth."