Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #106773 > unrolled thread
| Started by | Chris Angelico <rosuav@gmail.com> |
|---|---|
| First post | 2016-04-10 13:52 +1000 |
| Last post | 2016-04-10 13:52 +1000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: REMOVE ME Chris Angelico <rosuav@gmail.com> - 2016-04-10 13:52 +1000
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2016-04-10 13:52 +1000 |
| Subject | Re: REMOVE ME |
| Message-ID | <mailman.2.1460260336.424.python-list@python.org> |
On Sun, Apr 10, 2016 at 1:46 PM, fan nie <niefan68@gmail.com> wrote:
>
> --
> https://mail.python.org/mailman/listinfo/python-list
Sure. I presume you mean 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 ingenious technique guarantees that you never have dead objects
in your list, by having each object remove itself when it dies.
ChrisA
Back to top | Article view | comp.lang.python
csiph-web