In article ,
pyt...@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 objec
__del__ is unreliable. But don't take my word, check out the doc.
https://docs.python.org/3.2/reference/datamodel.html#object.__del__
--
https://mail.python.org/mailman/listinfo/python-list
On 2015-01-25 18:23, Mario Figueiredo wrote:
Consider the following class:
class A:
def __init__(self, value):
self.value = value
def __del__(self):
print("'A' instance being collected...")
def __repr__(self):
return str(se
In article , mar...@gmail.com
says...
> [...]
Forgot to mention this is Python 3.4.2
--
https://mail.python.org/mailman/listinfo/python-list
Consider the following class:
class A:
def __init__(self, value):
self.value = value
def __del__(self):
print("'A' instance being collected...")
def __repr__(self):
return str(self.value)
If ran as a script, the destructor behavior