[Python-ideas] weakrefs

stoneleaf ethan at stoneleaf.us
Sat May 19 17:29:02 CEST 2012


On May 19, 5:33 am, Michael Foord wrote:
> So you're taking a *dependence* on the reference counting garbage
> collection of the CPython implementation, and when that doesn't work for
> you with other implementations trying to force the same semantics on them.

I am not trying to force anything.  I stated what I would like, and
followed
up with questions to further the discussion.


> Your proposal can't reasonably be implemented by other implementations as
> working out whether there are any references to an object is an expensive
> operation.

Then that nixes it.  The (debatable) advantages aren't worth a large
expenditure in programmer time, nor a large hit in performance.


> A much better technique would be for you to use explicit
> life-cycle-management (like the with statement) for your objects.

I'm leaning strongly towards just not allowing temporary changes,
which will
also solve my problem.


Thanks everyone for the feedback.

~Ethan~



More information about the Python-ideas mailing list