"Guido van Rossum" <guido at python.org> wrote in message news:ca471dc20606071625y55199a73r6ae369d5c8de4f52 at mail.gmail.com... > This is by design. > > The intent is that as long as you call something that returns no > value, your last result is not thrown away. IOW _ is the last result > that wasn't None. > > Please don't change this. What might be improved is the documentation of this, which I could not find in a few minutes of searching. As of current 2.4 docs, the Tutorial, Language, and Library manuals all have index pages for identifiers beginning with '_' but none contain '_' itself. (And none have entries for 'underscore'.) Language Reference 2.3.2 Reserved classes of identifiers lists all the other special identifier classes starting with '_' but not '_' itself. I think this would be a good place for an entry for '_' and its special meaning in interactive mode. Tutorial 2.1.2 Interactive Mode would be another place to mention the special use of '_'. If there is something I missed (that is not indexed), then I missed it. Terry Jan Reedy
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