On Aug 30, 11:35 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
I have an object and wish to set an attribute on it which,
unfortunately for me, is read-only.
How can I go about this?
Cheers.
-T
Could you show the object you want to set his attribute?
Until that, it's difficult to answer
[EMAIL PROTECTED] wrote:
I have an object and wish to set an attribute on it which,
unfortunately for me, is read-only.
How can I go about this?
This seems like a bizarre requirement. Why is the attribute read-only in
the first place? How is the read-only mechanism enforced? Is the object
On Aug 31, 6:14 pm, Alexandre Badez [EMAIL PROTECTED] wrote:
On Aug 30, 11:35 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
I have an object and wish to set an attribute on it which,
unfortunately for me, is read-only.
How can I go about this?
Cheers.
-T
Could you show the object
[EMAIL PROTECTED] wrote:
On Aug 31, 6:14 pm, Alexandre Badez [EMAIL PROTECTED] wrote:
On Aug 30, 11:35 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
I have an object and wish to set an attribute on it which,
unfortunately for me, is read-only.
How can I go about this?
Cheers.
-T
Could
I have an object and wish to set an attribute on it which,
unfortunately for me, is read-only.
How can I go about this?
Cheers.
-T
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 30, 10:35 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
I have an object and wish to set an attribute on it which,
unfortunately for me, is read-only.
If it's read-only then you can't set it!
How can I go about this?
Joke aside, I think you need to be more specific.
--
Arnaud
--
Arnaud Delobelle wrote:
On Aug 30, 10:35 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
I have an object and wish to set an attribute on it which,
unfortunately for me, is read-only.
If it's read-only then you can't set it!
How can I go about this?
Joke aside, I think you need to be
[EMAIL PROTECTED] wrote:
I have an object and wish to set an attribute on it which,
unfortunately for me, is read-only.
How can I go about this?
Cheers.
-T
I guess we all need an code example to show us the way 'read only' is
implemented.
If you cant access to the class wich you are
[EMAIL PROTECTED] wrote:
I have an object and wish to set an attribute on it which,
unfortunately for me, is read-only.
How can I go about this?
Can you simply subclass the object's class, intercept __setattr__ and
__getattribute__, and spoof the read-only attribute? E.g.:
class A(object):