Carl Meyer added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21145>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to