Robin Becker wrote:
> Kay Schluehr wrote:
> > Robin Becker wrote:
> >
> >
> >>I thought that methods were always overridable.
> >>In this case the lookup on the
> >>class changes the behaviour of the one and only property.
> >
> >
> > How can something be made overridable that is actually overridab
Alex Martelli wrote:
..
> If (e.g.) __set__ needs to behave differently when applied to certain
> instances rather than others, then it had better be "messed with"
> (overridden) compared to property.__set__ since the latter has no such
> proviso. Of course, your architecture as sketched below
Robin Becker <[EMAIL PROTECTED]> wrote:
...
> in answer to Bengt & Bruno here is what I'm sort of playing with. Alex
> suggests class change as an answer, but that looks really clunky to me.
> I'm not sure what
Changing class is indeed 'clunky', though it might have been necessary
depending on
On Tue, 18 Oct 2005 08:00:51 +, Robin Becker <[EMAIL PROTECTED]> wrote:
>Bruno Desthuilliers wrote:
>> Robin Becker a écrit :
>>
>>> Is there a way to override a data property in the instance? Do I need
>>> to create another class with the property changed?
>>
>>
>> Do you mean attributes
Kay Schluehr wrote:
> Robin Becker wrote:
>
>
>>I thought that methods were always overridable.
>>In this case the lookup on the
>>class changes the behaviour of the one and only property.
>
>
> How can something be made overridable that is actually overridable? I
> didn't know how to better ex
Robin Becker wrote:
> I thought that methods were always overridable.
> In this case the lookup on the
> class changes the behaviour of the one and only property.
How can something be made overridable that is actually overridable? I
didn't know how to better express the broken polymorphism of Pyt
Steven Bethard wrote:
> Robin Becker wrote:
>
...
>
> Can you add the object to be observed as another parameter to the add
> method?
>
> py> class ObservableProperty(property):
> ... def __init__(self, *args, **kwargs):
..
> py> A.x.add(b, obs2)
> py> b.x = 7
> obs2: 7
>
> Probabl
Robin Becker wrote:
> ## my silly example
> class ObserverProperty(property):
> def __init__(self,name,observers=None,validator=None):
> self._name = name
> self._observers = observers or []
> self._validator = validator or (lambda x: x)
> self._pName = '_' + nam
Kay Schluehr wrote:
> Robin Becker wrote:
>
>>Is there a way to override a data property in the instance? Do I need to
>>create
>>another class with the property changed?
>>--
>>Robin Becker
>
>
> It is possible to decorate a method in a way that it seems like
> property() respects overridden m
Robin Becker wrote:
> Is there a way to override a data property in the instance? Do I need to
> create
> another class with the property changed?
> --
> Robin Becker
It is possible to decorate a method in a way that it seems like
property() respects overridden methods. The decorator cares
polymo
bruno modulix wrote:
.
>
> Could you elaborate ? Or at least give an exemple ?
.
in answer to Bengt & Bruno here is what I'm sort of playing with. Alex suggests
class change as an answer, but that looks really clunky to me. I'm not sure
what
Alex means by
> A better design might be to
Robin Becker <[EMAIL PROTECTED]> wrote:
> Bruno Desthuilliers wrote:
> > Robin Becker a écrit :
> >
> >> Is there a way to override a data property in the instance? Do I need
> >> to create another class with the property changed?
> >
> > Do you mean attributes or properties ?
>
> I mean proper
Robin Becker wrote:
> Bruno Desthuilliers wrote:
>
>> Robin Becker a écrit :
>>
>>> Is there a way to override a data property in the instance? Do I need
>>> to create another class with the property changed?
>>
>>
>>
>> Do you mean attributes or properties ?
>
>
> I mean property here.
Ok, was
Bruno Desthuilliers wrote:
> Robin Becker a écrit :
>
>> Is there a way to override a data property in the instance? Do I need
>> to create another class with the property changed?
>
>
> Do you mean attributes or properties ?
I mean property here. My aim was to create an ObserverProperty class
On 17 Oct 2005 11:13:32 -0700, "SPE - Stani's Python Editor" <[EMAIL
PROTECTED]> wrote:
>No, you can just do it on the fly. You can even create properties
>(attributes) on the fly.
>
>class Dummy:
> property = True
>
>d = Dummy()
>d.property = False
>d.new = True
>
a simple attribute is not a p
On Mon, 17 Oct 2005 18:52:19 +0100, Robin Becker <[EMAIL PROTECTED]> wrote:
>Is there a way to override a data property in the instance? Do I need to
>create
>another class with the property changed?
How do you need to "override" it? Care to create a toy example with a
"wish I could here" comme
Robin Becker a écrit :
> Is there a way to override a data property in the instance? Do I need to
> create another class with the property changed?
Do you mean attributes or properties ?
--
http://mail.python.org/mailman/listinfo/python-list
No, you can just do it on the fly. You can even create properties
(attributes) on the fly.
class Dummy:
property = True
d = Dummy()
d.property = False
d.new = True
Stani
--
SPE - Stani's Python Editor http://pythonide.stani.be
--
http://mail.python.org/mailman/listinfo/python-list
18 matches
Mail list logo