Object destruction delayed on interactive prompt

Mario Figueiredo marfig at gmail.com
Sun Jan 25 14:29:15 EST 2015


In article <mailman.18133.1422213206.18130.python-list at python.org>, 
python at mrabarnett.plus.com says...
> In the REPL, the result of an expression is bound to '_':
> 
>  >>> x1 = A(12)
>  >>> x1 # _ will be bound to the result.
> 12
>  >>> x1 = 'string'
>  >>> # At this point, _ is still bound to the object.
>  >>> 0 # This will bind _ to another object, so the previous object can 
> be collected.
> 'A' instance being collected...
> 0

Aha! Thank you.



More information about the Python-list mailing list