--
https://mail.python.org/mailman/listinfo/python-list
On Tue, Apr 12, 2016 at 9:10 AM, Steven D'Aprano wrote:
> Hence "self.things" will return the same
> list each time, the one defined as a class attribute, regardless of
> which "self" does the lookup.
>
> If a method were to assign to the attribute, for example "self.things =
something like this:
>>
>> class Thing:
>> things = []
>> def __init__(self):
>> self.things.append(self)
>> def __del__(self):
>> # Remove me when I'm dead
>> self.things.remove(self)
>>
>> This ing
_(self):
self.things.append(self)
def __del__(self):
# Remove me when I'm dead
self.things.remove(self)
This ingenious technique guarantees that you never have dead objects
in your list, by having each object remove itself when it dies.
ChrisA
I'm not quite sure how tongue in cheek ChrisA's
On Sunday 10 April 2016 13:46, fan nie wrote:
>
We cannot remove you. You subscribed, you have to unsubscribe yourself.
If you look at the footer of this email, right at the bottom, it should have
instructions for unsubscribing.
Otherwise, go here:
fan nie writes:
> [no content]
Thank you for sending a message to everyone on the mailing list, with
the full correct information on how to check subscription settings and
how to unsubscribe.
As you are no doubt aware, since you left the message body entirely
blank to draw
ef __del__(self):
# Remove me when I'm dead
self.things.remove(self)
This ingenious technique guarantees that you never have dead objects
in your list, by having each object remove itself when it dies.
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
--
https://mail.python.org/mailman/listinfo/python-list
please remove me from this list, thanks
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, May 4, 2008 at 2:48 PM, Vladimir Kropylev [EMAIL PROTECTED] wrote:
please remove me from this list, thanks
--
http://mail.python.org/mailman/listinfo/python-list
Follow that link (http://mail.python.org/mailman/listinfo/python-list)
and see the Python-list Subscribers section
10 matches
Mail list logo