Minor annoyances with properties

eb303 eric.brunel.pragmadev at gmail.com
Fri May 28 05:46:36 EDT 2010


On May 27, 3:14 pm, Neil Cerutti <ne... at norwich.edu> wrote:
> On 2010-05-27, eb303 <eric.brunel.pragma... at gmail.com> wrote:
>
> > I've been using Python properties quite a lot lately and I've
> > found a few things that are a bit annoying about them in some
> > cases. I wondered if I missed something or if anybody else has
> > this kind of problems too, and if there are better solutions
> > than the ones I'm using ATM.
> > The first annoyance is when I want to specialize a property in a
> > subclass.
>
> See:
>
> URI:http://infinitesque.net/articles/2005/enhancing%20Python%27s%20proper...
>
> --
> Neil Cerutti
> *** You found a dead moose-rat. You sell the hide for $200. ***

Thanks for the suggestion, but it looks a bit heavy… Performing the
name lookup on the specialized object each time the property is
accessed seems a bit overkill. I'd really just like a simple way to
tell in the subclass: now, the setter methof for property p is this
one, only that…

Thanks again anyway.
 - Eric -



More information about the Python-list mailing list