Variable assigned to the last executed line?
I just found something weird in the Python interpreter. Let me show you:

    $ python
    Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53) 
    [GCC 4.5.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> _
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    NameError: name '_' is not defined
    >>> 5 + 4
    9
    >>> _
    9
    >>> 'Hello world'
    'Hello world'
    >>> _
    'Hello world'
    >>> type(3.5)
    <type 'float'>
    >>> _
    <type 'float'>

(You can try it in your interpreter, there's no tricks.)

What??? The result of last executed line is being assigned to a variable named `_`. Does anybody know something about it? Is there any documentation about it? In which situation could it be useful?
Variable assigned to the last executed line?
===

I just found something weird in the Python interpreter. Let me show you:

    $ python
    Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53) 
    [GCC 4.5.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> _
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    NameError: name '_' is not defined
    >>> 5 + 4
    9
    >>> _
    9
    >>> 'Hello world'
    'Hello world'
    >>> _
    'Hello world'
    >>> type(3.5)
    <type 'float'>
    >>> _
    <type 'float'>

(You can try it in your interpreter, there's no tricks.)

What??? The result of last executed line is being assigned to a variable named `_`. Does anybody know something about it? Is there any documentation about it? In which situation could it be useful?