En Thu, 19 Feb 2009 01:29:17 -0200, Alan G Isaac
escribió:
OK, that's good. I'd like to sometimes lock attribute creation on
instances of a class but still allow properties to function
correctly. Will something like below be satisfactory?
def __setattr__(self, attr, val):
"""If insta
On 2/18/2009 6:15 PM Gabriel Genellina apparently wrote:
type(a).x
OK, that's good. I'd like to sometimes lock attribute creation on
instances of a class but still allow properties to function
correctly. Will something like below be satisfactory?
Thanks,
Alan
def __setattr__(self, attr, v
En Wed, 18 Feb 2009 20:48:17 -0200, Alan G Isaac
escribió:
What is a reliable way to get the
the property object for an instance attribute?
(Or more generally, to get the descriptor
controlling an attribute?)
If class ``A`` defines the property ``x`` and ``a``
in an instance of ``A``, then y
What is a reliable way to get the
the property object for an instance attribute?
(Or more generally, to get the descriptor
controlling an attribute?)
If class ``A`` defines the property ``x`` and ``a``
in an instance of ``A``, then you can just use
``type(a).__dict__['x']`` to get the property ob