Veek M wrote:
> you've misunderstood my question
There were a lot of foobars bazzing in my head, but at least I tried ;)
> , let me try again:
>
> So this is a simple descriptor class and as you can see, dunder-set needs
> 3 args: the descriptor CONTAINER/Bar-instance is the first arg, then a
you've misunderstood my question, let me try again:
So this is a simple descriptor class and as you can see, dunder-set needs
3 args: the descriptor CONTAINER/Bar-instance is the first arg, then a
reference to the using instance/Foo-instance
class Bar(object):
def __set__(self,
Veek M wrote:
> class Foo(object):
> @property
> def name(self):
> if hasattr(self, '_name'):
> print('Foo name', self._name)
> return self._name
> else:
> return 'default'
>
> @name.setter
> def name(self, value):
>
class Foo(object):
@property
def name(self):
if hasattr(self, '_name'):
print('Foo name', self._name)
return self._name
else:
return 'default'
@name.setter
def name(self, value):
print('Foo', self)
self._name =