From: Eric F. <ef...@ha...> - 2007-03-21 17:13:31
|
Fernando Perez wrote: > On 3/21/07, Eric Firing <ef...@ha...> wrote: > >> Properties would be OK for 2.3; I was thinking we might want to use >> them. When a getter and setter already exist, all it takes is the one >> extra line of code, plus a suitable (unused) name for the property. I >> decided not to pursue traits (if at all) until we can use the Enthought >> package as-is. But I think that properties could be converted to traits >> very easily if we wanted to do that in the future, so starting with >> properties would not be wasted effort. This is getting a bit off-topic, >> though. > > Minor note: if you are going to use properties, make sure all classes > using them are new-style (inherit from object). With old-style > classes, properties fail in silent and mysterious ways that may lead > to much head-scratching. Not minor at all--I ran into exactly this problem a few months ago with my first foray into properties, and it did indeed take quite a bit of head-scratching before I realized the problem. And I am embarrassed to say that I had forgotten about it until your reminder above. Thanks. Eric |