Re: Problem with Property

2006-02-25 Thread none
Steve Holden wrote: > "none <"@bag.python.org wrote: > It seems particularly odd to want to put getters and setters behind > property access. What does the extra layer buy you? The purpose is that there is more to the accessors then I posted. The setters do some 'mark dirty' bookeeping whenever

Re: Problem with Property

2006-02-25 Thread Peter Hansen
"none <"@bag.python.org wrote: > I'm trying to implement a simple repeateable property mechansism so I > don't have to write accessors for every single instance variable I have. ... > Any ideas? Yes, don't write accessors for every single instance variable you have. In some languages that mig

Re: Problem with Property

2006-02-25 Thread Felipe Almeida Lessa
Em Sáb, 2006-02-25 às 09:14 -0500, Steve Holden escreveu: > It seems particularly odd to want to put getters and setters behind > property access. What does the extra layer buy you? I can only think of some kind of debugging. Maybe? > regards > Steve Cya, Felipe. -- "Quem excele em empregar

Re: Problem with Property

2006-02-25 Thread none
André Malo wrote: > * none wrote: > > >>classMyObject: > > [...] > > >>As you can see, the _getProperty() method gets called properly when I do >> 'o.value' but 'o.value = 123' does not seem to use the property >>stucture. I can't figure out why 'o.value=123' does not call >>_setProperty()

Re: Problem with Property

2006-02-25 Thread none
André Malo wrote: > * none wrote: > > >>classMyObject: > > [...] > > >>As you can see, the _getProperty() method gets called properly when I do >> 'o.value' but 'o.value = 123' does not seem to use the property >>stucture. I can't figure out why 'o.value=123' does not call >>_setProperty()

Re: Problem with Property

2006-02-25 Thread Steve Holden
"none <"@bag.python.org wrote: > I'm trying to implement a simple repeateable property mechansism so I > don't have to write accessors for every single instance variable I have. Please don't do that. The Python way is to use direct access to instance variables unless there's a good reason not to

Re: Problem with Property

2006-02-25 Thread André Malo
* none wrote: > classMyObject: [...] > As you can see, the _getProperty() method gets called properly when I do > 'o.value' but 'o.value = 123' does not seem to use the property > stucture. I can't figure out why 'o.value=123' does not call > _setProperty() > > Any ideas? property only wor

Problem with Property

2006-02-25 Thread none
I'm trying to implement a simple repeateable property mechansism so I don't have to write accessors for every single instance variable I have. classMyObject: def __init__ (self): self.initialize() def initialize(self): self._value=None def _setPrope

problem with property docstrings

2005-07-23 Thread Michael Muller
I've observed something strange about property docstrings and I'm wondering if anyone here can clarify what's going on: if I create a class derived from property, the docstrings of the instances end up being that of the derived class, not the docstring passed into the property constructor. Examp