473,386 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

@x.setter property implementation

Hello

I found out about the new methods on properties, .setter()
and .deleter(), in python 2.6. Obviously that's a very tempting
syntax and I don't want to wait for 2.6...

It would seem this can be implemented entirely in python code, and I
have seen hints in this directrion. So before I go and try to invent
this myself does anyone know if there is an "official" implementation
of this somewhere that we can steal until we move to 2.6?
Cheers
Floris
Apr 6 '08 #1
3 1727
I found out about the new methods on properties, .setter()
and .deleter(), in python 2.6. Obviously that's a very tempting
syntax and I don't want to wait for 2.6...

It would seem this can be implemented entirely in python code, and I
have seen hints in this directrion. So before I go and try to invent
this myself does anyone know if there is an "official" implementation
of this somewhere that we can steal until we move to 2.6?
The 2.6 source?
Apr 6 '08 #2
On Apr 6, 6:41 pm, "Daniel Fetchinson" <fetchin...@googlemail.com>
wrote:
I found out about the new methods on properties, .setter()
and .deleter(), in python 2.6. Obviously that's a very tempting
syntax and I don't want to wait for 2.6...
It would seem this can be implemented entirely in python code, and I
have seen hints in this directrion. So before I go and try to invent
this myself does anyone know if there is an "official" implementation
of this somewhere that we can steal until we move to 2.6?

The 2.6 source?
Have been grepping all over the place and failed to find it. I found
the test module for them, but that doesn't get me very far...
Apr 7 '08 #3
2008/4/7, Floris Bruynooghe <fl***************@gmail.com>:
>
Have been grepping all over the place and failed to find it. I found
the test module for them, but that doesn't get me very far...
I think you should take a look at 'descrobject.c' file in 'Objects' directory.

--
Wbr, Andrii Mishkovskyi.

He's got a heart of a little child, and he keeps it in a jar on his desk.
Apr 7 '08 #4

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

Similar topics

5
by: Flipje | last post by:
In my view, there is a major drawback to using attributes: the getter and the setter have identical protection levels. But I usually want the getter to be public and the setter to be protected or...
4
by: Jimbo | last post by:
I am sort of new to C#. Currently have a private property called "_name" in a class. I have written a public getter and setter routine for it called "Name". Currently, the getter for the...
4
by: jarek | last post by:
Hi, this is my code: CSSStyleDeclaration.prototype.__defineSetter__('display', displaySetter); function displaySetter(value) { var parent = findParent(document, this); if (parent) {
12
by: Adam Sandler | last post by:
Hi all, I hope this is an easy one... Using VWD 2005. When I call my accessor method (getName) I always receive an empty string back. Debugging shows there should be something there but I...
5
by: kronrn | last post by:
Hi Folks Can anyone confirm that the code public string Name { get; set; }
6
by: Peter Franks | last post by:
Is it possible to deserialize a class that has a public property w/ a setter, but no getter? I'm not finding anything that would allow this -- Presuming that is is NOT possible, what are the...
4
by: Henrik Dahl | last post by:
I have the fragment below as contents of a <Gridelement. The idea is that if the checkbox is checked the <TreeViewelement should only span one instead of two columns. When I check the checkbox the...
0
by: Hans Koller | last post by:
Hello group, I design a class to bind it to a property grid for easy modification of some settings. My problem is now that I want to raise an event when a settings has been changed. Thats not a...
1
by: gamehack | last post by:
Hi all, I was looking around the net to figure out how I can use the property() descriptor to make a property readable by everyone and only settable by the class or any derived classes. Thanks....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.