472,334 Members | 1,534 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Overwrite only one function with property()

Hi list!
It is possible to overwrite only one function with the property-function?

x = property(getx, setx, delx, 'doc')

I just want to overwrite setx, but when I set the others to None,
I can't read and del the member. Any ideas or is this not possible?

Thank you!
Kai
Nov 18 '06 #1
3 1899
Kai Kuehne wrote:
Hi list!
It is possible to overwrite only one function with the property-function?

x = property(getx, setx, delx, 'doc')

I just want to overwrite setx, but when I set the others to None,
I can't read and del the member. Any ideas or is this not possible?
There are no default functions for getx, setx, delx; you have to
specify what you expect to happen when you write a.p, a.p = v and del
a.p, respectively. What would, for example, be the default getx that
you don't want to overwrite ?

George

Nov 18 '06 #2
On 18 nov, 19:06, "Kai Kuehne" <kai.kue...@gmail.comwrote:
It is possible to overwrite only one function with the property-function?

x = property(getx, setx, delx, 'doc')

I just want to overwrite setx, but when I set the others to None,
I can't read and del the member. Any ideas or is this not possible?
Do you want to override the setter of an existing property, in a
derived class?

Nov 18 '06 #3
Kai Kuehne a écrit :
Hi list!
It is possible to overwrite only one function with the property-function?
property is not function, it's a class. And it doesn't "overwrite" anything.
x = property(getx, setx, delx, 'doc')

I just want to overwrite setx, but when I set the others to None,
I can't read and del the member.
You don't "overwrite" setx, you pass it as an argument to the property
constructor call.
Any ideas or is this not possible?
Read this, and you'll have a detailed answer:
http://users.rcn.com/python/download/Descriptor.htm

Thank you!
Kai
Nov 19 '06 #4

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

Similar topics

5
by: Gord | last post by:
Hello, If you set the flag for an overwrite prompt using the 'Save' common dialog, how do you read the response when the user clicks the Yes or...
2
by: chris | last post by:
hi, i am tinkering with properties of new style classes: class Base(object): def m(self): return 'p of Base' p = property(m) class...
3
by: David Baumgarten | last post by:
I am trying to download a file from a ftp server and if the file already exists to overwrite it. Here is my code: FtpGetFile(hConnection,...
11
by: Florian Loitsch | last post by:
I'm currently writing a JS->Scheme compiler (which, using Bigloo, automatically yields a JS->C, JS->JVM, JS->.NET compiler), and have a question...
6
by: deko | last post by:
Is there a way to set a custom property on Access tables and/or queries to prevent them from being overwritten by import wizards? Any Access...
10
by: lgbjr | last post by:
Hi All, In VB.Net how do I determine if CapsLock is on/off (same for NumLock) and whether the input mode is set to Insert or Overwrite (Insert...
3
by: Developer | last post by:
I use the RichTextBox and sometimes put it into overwrite mode. I'd like the cursor to show whether its in overwrite or insert mode. I often...
1
by: Björn Langhof | last post by:
Hello. I'd like to overwrite a native function. It's the reload()-function of the document.location-object. My idea: document.location.reload...
2
by: hzgt9b | last post by:
I know how to overwrite a function. Normally this is what I would do: function someFunction() { /* orig definition here */ } //later in the...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...

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.