471,356 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,356 software developers and data experts.

Setting a read-only attribute

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

Aug 30 '07 #1
5 1633
On Aug 30, 10:35 pm, "tleeuwenb...@gmail.com" <tleeuwenb...@gmail.com>
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
Aug 30 '07 #2
Arnaud Delobelle wrote:
On Aug 30, 10:35 pm, "tleeuwenb...@gmail.com" <tleeuwenb...@gmail.com>
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.
To be more specific about much more specific you should be:
If you know the exact problem/hurdle you have to overcome, explain it.
Otherwise kindly provide the traceback (error message) you get when
attempting to set the attribute.

/W
Aug 30 '07 #3
tl**********@gmail.com 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 instantiated from, well,
maybe you can just post the error or exception you get.

Cheers.
Gerardo
Aug 30 '07 #4
On Aug 30, 11:35 pm, "tleeuwenb...@gmail.com" <tleeuwenb...@gmail.com>
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 to you.

PS: If the attribut is on read only, their must a good reason for
that ;)

Aug 31 '07 #5
tl**********@gmail.com 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
created in Python or in an extension module? Do you have any evidence
that "setting" the attribute will effect the required change in the
behavior of the object.

A little more information would be helpful.

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
--------------- Asciimercial ------------------
Get on the web: Blog, lens and tag the Internet
Many services currently offer free registration
----------- Thank You for Reading -------------

Aug 31 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Darrel | last post: by
8 posts views Thread by VB User | last post: by
14 posts views Thread by Roger Withnell | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.