[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?
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
>
> Cou
[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 obj
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
[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(objec
[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
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
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