OO and game design questions

Carl Banks pavlovevidence at gmail.com
Mon Oct 18 14:50:38 EDT 2010


On Oct 18, 6:50 am, dex <josipmisko... at gmail.com> wrote:
> > You're aware Python can collect reference cycles, correct?  You don't
> > have to delete references; Python will get them eventually.  
>
> I'm not sure I understand this part? If I don't delete all strong
> references, the object will not be deleted.
> It will persist and occupy memory as long as there's at least one
> reference to it (it could be part of inventory, or target of some
> action).

I was assuming the weak referencing was used to avoid reference
cycling.

I'm not sure if it's a good idea to let an item disappear from your
inventory by a weak reference disappearing.  It seems a little shaky
to not know where your objects are being referenced, but that's yout
decision.


Carl Banks



More information about the Python-list mailing list