> Isn't that::
>
>
>
> @propset(foo)
>
> def foo(self, value):
>
> self._value = value
Yeah, you are right.
Diez
--
http://mail.python.org/mailman/listinfo/python-list
Diez B. Roggisch wrote:
> In python 3.0, there will be an even nicer way - propset:
> @property
> def foo(self):
> return self._foo
> @propset
> def foo(self, value):
> self._value = value
Isn't that::
@propset(foo)
def foo(self, value):
self._value = valu
Joe P. Cool schrieb:
> On 18 Mrz., 21:59, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
>> Joe P. Cool schrieb:
>>> def _property_y(self):
>>> def _get(self):
>>> [...]
>> There are a few recipies, like this:
>>
>> class Foo(object):
>>
>> @apply
>> def foo():
>>
On 18 Mrz., 21:59, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> Joe P. Cool schrieb:
> > def _property_y(self):
> > def _get(self):
> > [...]
>
> There are a few recipies, like this:
>
> class Foo(object):
>
> [EMAIL PROTECTED]
> def foo():
> def fget(se
Joe P. Cool schrieb:
> Hi,
>
> I like C#'s style of defining a property in one place. Can the
> following way
> to create a property be considered reasonable Python style (without
> the
> print statements, of course)?
>
> class sample(object):
> def __init__(self):
> sample.y = self.