[issue16832] Expose cache validity checking support in ABCMeta

Nick Coghlan report at bugs.python.org
Sun May 26 02:52:26 CEST 2013


Nick Coghlan added the comment:

The reason I switched from suggesting an attribute/property to a module level function is because we don't really support properties for process global state. That's why sys has so many getters in it - to make them properties, you would have to add a class object to act as a holder for the property.

In this case, we appear to have a singleton that could hold the property (ABCMeta), which is why my original suggestion was to use an ABCMeta attribute. However, what I realised yesterday is that because ABCMeta is a type subclass, it means the only way to make the attribute a property in the future would be to add a metametaclass to hold the property definition.

Once I realised that... "if the implementation is hard to explain, it's a bad idea" tipped me over the edge into preferring a simple module level getter function that supported exactly the use cases we care about :)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16832>
_______________________________________


More information about the Python-bugs-list mailing list