Author carljm
Recipients Omer.Katz, alex, carljm, eric.araujo, madison.may, ncoghlan, pitrou, pydanny, r.david.murray, rhettinger, serhiy.storchaka, vstinner
Date 2016-11-11.20:25:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1478895931.42.0.893669835632.issue21145@psf.upfronthosting.co.za>
In-reply-to
Content
Uploaded a patch updated per Nick's comment.

Not opposed to waiting to see if someone is motivated to implement a version in C that supports __slots__, but if that doesn't happen by the Python 3.7 feature deadline, I don't think it should block this proven version.

It also occurred to me that we could probably support __slots__ in pure Python without harming the non-slots case by implementing a fallback cache in the descriptor itself, keyed by instance in a WeakKeyDictionary. I don't love having the behavior differ so much between the slots and non-slots case, but maybe it's better than not supporting slots at all.

Re setting and deleting: under the current patch, if you set or delete a cached property, you set or delete the cached value. I think this is fine and useful behavior, but it could perhaps be added explicitly to the documentation.
History
Date User Action Args
2016-11-11 20:25:31carljmsetrecipients: + carljm, rhettinger, ncoghlan, pitrou, vstinner, pydanny, eric.araujo, alex, r.david.murray, serhiy.storchaka, madison.may, Omer.Katz
2016-11-11 20:25:31carljmsetmessageid: <1478895931.42.0.893669835632.issue21145@psf.upfronthosting.co.za>
2016-11-11 20:25:31carljmlinkissue21145 messages
2016-11-11 20:25:31carljmcreate