[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] weakref WeakKeyDictionary machinery.
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] weakref WeakKeyDictionary machinery.
- From: "Charlie Nolan" <funnyman3595@xxxxxxxxx>
- Date: Sun, 1 Jun 2008 16:58:32 -0500
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Sun, 01 Jun 2008 17:58:39 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=6LdBTfewOMDpKiq109BKn4JWbt1/wDbyYVNUCT9QIUo=; b=bBYkZpPaVNsSkJCjP6c6+Al7nS7Hdq8VD0Zd/qxZQiQsX58dL7u3NW8K8VtjarXsrfGGAkZxUA9Uq6bnH27F9Qkm/nI4LjNpGQ46jurs5AIHUdGyScCaBGYwVSekldlmYEg73hL7hqFhPd1i7FSCVoe5QKIquAq3IGYW29Va0dU=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=maNqJBgfZNTk4FkUDOWdBbBqeCBm8vmTCNYdHYHJcHCexZsx56NHpFWbdTQd7jeEM+5uiTLLidvb3af4GFO6yNH5aAYgvm0pfeqy2UmS0JWMypeVD2P8SG7TprxhCa5k48pG8vNwwd1I0Nfd91SuzelHQa7y4f4vIz0EeKS3Atc=
- In-reply-to: <929660.84556.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- References: <929660.84556.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
And why are you asking us? This is the pygame mailing list, last I
checked, and a quick search of the code suggests that pygame doesn't
use either Weak*Dictionary.
On 6/1/08, Gabriel Hasbun <gastomaster@xxxxxxxxx> wrote:
> Hello I searched the whole web for good examples on weakref module's
> WeakKeyDictionary, but have found none, All I find is the Python Docs
> explanations, and some examples which actually doesn't explain how the
> mechanism of key reference removal works:
>
> import weakref
> class Tracking:
> _instances_dict = weakref.WeakValueDictionary( )
> _num_generated = 0
> def _ _init_ _(self):
> Tracking._num_generated += 1
> Tracking._instances_dict[Tracking._num_generated] = self
> def instances( ): return _instances_dict.values( )
> instances = staticmethod(instances)
>
>
>
>