On Feb 12, 12:27 pm, TechieInsights wrote:
> Ok... for some closure I have written a class to automate the
> process. It takes getters and setters and deleters and then sets the
> property automatically. Sweet!
>
> class AutoProperty(type):
> def __new__(cls, name, bases, methoddict):
>
Ok... for some closure I have written a class to automate the
process. It takes getters and setters and deleters and then sets the
property automatically. Sweet!
class AutoProperty(type):
def __new__(cls, name, bases, methoddict):
processed = []
getter =
On Feb 12, 9:27 am, josh logan wrote:
> On Feb 12, 10:58 am, TechieInsights wrote:
>
>
>
> > Oh... one other thing that would be really cool is to do this with AOP/
> > descriptors! I just haven't been able to get that to work either.
> > Basics...
>
> > @readonly
> > class MyClass(object):
> >
On Feb 12, 10:58 am, TechieInsights wrote:
> Oh... one other thing that would be really cool is to do this with AOP/
> descriptors! I just haven't been able to get that to work either.
> Basics...
>
> @readonly
> class MyClass(object):
> def __init__(self, x):
> self.set_x
Oh... one other thing that would be really cool is to do this with AOP/
descriptors! I just haven't been able to get that to work either.
Basics...
@readonly
class MyClass(object):
def __init__(self, x):
self.set_x(x)
def get_x(self):
return self._
Thank you for the suggestion!bruno at modulix <[EMAIL PROTECTED]> wrote: limodou wrote:> On 2/10/06, john peter wrote:(snip)>> what do i have to do if i want my application code to have>>read-only>> attributes?>>> I think you may consider property() built-in function:> > property( [fget[, fset[,
limodou wrote:
> On 2/10/06, john peter <[EMAIL PROTECTED]> wrote:
(snip)
>> what do i have to do if i want my application code to have
>>read-only
>> attributes?
>>
> I think you may consider property() built-in function:
>
> property( [fget[, fset[, fdel[, doc)
>
> Return a property attrib
On 2/10/06, john peter <[EMAIL PROTECTED]> wrote:
> while reading the lib manual, i came across mentions of read-only
> attributes.
> for example, a method has a read-only attribute (called _im_self ?) for
> binding
> a class instance to the method. is such a facility available to custom
> applic