Re: Re: Set a variable as in setter

2009-05-25 Thread Dave Angel
Kless wrote: On 24 mayo, 12:27, Duncan Booth wrote: Kless wrote: Is there any way to simplify the next code? Because I'm setting a variable by default of the same way than it's set in the setter. --- class Foo(object): def __init__(self, bar): self._ba

Re: Set a variable as in setter

2009-05-24 Thread Kless
On 24 mayo, 15:33, Kless wrote: > On 24 mayo, 12:27, Duncan Booth wrote: > > > Kless wrote: > > > Is there any way to simplify the next code? Because I'm setting a > > > variable by default of the same way than it's set in the setter. > > > > --- > > > class Foo(object): > > >  

Re: Set a variable as in setter

2009-05-24 Thread Kless
On 24 mayo, 12:27, Duncan Booth wrote: > Kless wrote: > > Is there any way to simplify the next code? Because I'm setting a > > variable by default of the same way than it's set in the setter. > > > --- > > class Foo(object): > >    def __init__(self, bar): > >       self._bar = s

Re: Set a variable as in setter

2009-05-24 Thread Mike Kazantsev
On Sun, 24 May 2009 19:03:26 +0600 Mike Kazantsev wrote: > On Sun, 24 May 2009 05:06:13 -0700 (PDT) > Kless wrote: > > > Is there any way to simplify the next code? Because I'm setting a > > variable by default of the same way than it's set in the setter. > > > > --- > > class

Re: Set a variable as in setter

2009-05-24 Thread Mike Kazantsev
On Sun, 24 May 2009 05:06:13 -0700 (PDT) Kless wrote: > Is there any way to simplify the next code? Because I'm setting a > variable by default of the same way than it's set in the setter. > > --- > class Foo(object): >def __init__(self, bar): > self._bar = self._change

Re: Set a variable as in setter

2009-05-24 Thread Duncan Booth
Kless wrote: > Is there any way to simplify the next code? Because I'm setting a > variable by default of the same way than it's set in the setter. > > --- > class Foo(object): >def __init__(self, bar): > self._bar = self._change(bar) # !!! as setter What's wrong with

Set a variable as in setter

2009-05-24 Thread Kless
Is there any way to simplify the next code? Because I'm setting a variable by default of the same way than it's set in the setter. --- class Foo(object): def __init__(self, bar): self._bar = self._change(bar) # !!! as setter @property def bar(self): return se