interesting bound-built-in-method technique
Michael Hudson
mwh21 at cam.ac.uk
Thu Jan 18 19:44:24 EST 2001
"Steve Holden" <sholden at holdenweb.com> writes:
[snip]
> >>> m = {'parrot': "alive"}
> >>> f('parrot')
> 'dead'
>
> It just removes the mutable object reference from the namespace, presumably
> meaning you can't change it any more. Neat. But will the reference to its
> method be enough to stop Python from garbage collecting it [I have to
> believe the answer is 'yes'].
Yes.
Cheers,
M.
--
... but I'd rather not reinvent the wheel if I don't have to. On
the other hand, if the currently instantiated version of the wheel
consists of a square rock covered with moss, I might as well just
start fresh. -- Roy Smith, comp.lang.python
More information about the Python-list
mailing list