473,804 Members | 3,191 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Writing a read only attribute

Hello,
it is possible to force in some way a write to a read-only attribute of
a python object? In which case?
Thanks for any answer.

F. Pollastri
Jul 6 '07 #1
1 2925
On Jul 6, 8:27 am, Fabrizio Pollastri <pollas...@irit i.cnr.itwrote:
Hello,
it is possible to force in some way a write to a read-only attribute of
a python object? In which case?
Thanks for any answer.

F. Pollastri
What do you mean by read-only attribute?
If you are trying to change attributes of built-in objects, there is
no hope:
>>'astring'.upp er = 2
---------------------------------------------------------------------------
exceptions.Attr ibuteError

AttributeError: 'str' object attribute 'upper' is read-only

If the read-only attribute has been implemented via a property, there
is a way
to write it, but you should tell us more about your case.

Michele Simionato

Jul 6 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3420
by: Michael Winter | last post by:
Below is the IDL definition of the HTMLOptionElement. interface HTMLOptionElement : HTMLElement { readonly attribute HTMLFormElement form; attribute boolean defaultSelected; readonly attribute DOMString text; attribute long index; attribute boolean disabled; attribute DOMString label; readonly attribute boolean selected;
0
1430
by: Chris Birmele | last post by:
I am having difficulties maintaining table relationships when writing XML files, despite having set the relations property NESTED to TRUE. I assume therefore that something is wrong with my code. Can anyone help? CODE ==== While xmlReader.Read() 'add row to tool table
5
4347
by: Phil Kelly | last post by:
Hi I need to write the contents of a structure to a binary file - there is one string and 2 integers, but I can't seem to figure out how to write the data correctly. If I am simply writing text to a file there is no problem - that starts when I attempt to write the structure. Can someone help me out, please?
2
2425
by: Robert Reijntjes | last post by:
Hi, I need to read/write data from/to binary files that have an already defined. This means I can't define classes with the attribute. The files also have arrays with variable length. This means I can't use the StructLayout attribute like in here: http://www.builderau.com.au/architect/webservices/0,39024590,20277904,00.htm
6
1931
by: Mizipzor | last post by:
Hi, this is my first mail to the list (and any list for that matter) so any pointers on errors from my part would be appreciated. Im more used to forums. To start off, Ive read some python documents and done some small apps so I think I can say I know it semi-well, and I know c++ very well. But I want learn python even better, since I know that a company I aim to be employed by make heavy use of python, knowing python myself would give...
2
365
by: Fabrizio Pollastri | last post by:
My code is the following: from Tkinter import * def tk_dummy_call(*args): return root = Tk() # save call address
118
4706
by: Chuck Cheeze | last post by:
This might be in the wrong group, but... Here is an example of my data: entry_id cat_id 1 20 2 25 3 30 4 25 5 35
0
9707
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9585
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10323
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10082
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5658
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4301
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3823
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2997
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.