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 <rep...@bugs.python.org>
<http://bugs.python.org/issue16832>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to