[Product-Developers] @property strips acquisition context

Martijn Pieters mj at zopatista.com
Tue Sep 1 07:33:29 UTC 2009

On Mon, Aug 31, 2009 at 21:42, Hedley Roos<hedleyroos at gmail.com> wrote:
> I still cannot get it to work. It is not a train smash but even so I'd
> like to know what is wrong. How did you know you can use
> ComputedAttribute as a decorator?

I didn't; I forgot about the extra unwrapping parameter. Mea culpa! As
suggested, you could create your own decorator that uses

  def acqproperty(func):
      return ComputedAttribute(func, 1)

or better still:

  def acqproperty(level=1):
      def _decorator(func):
          return ComputedAttribute(func, level)
      return _decorator

Martijn Pieters

More information about the Product-Developers mailing list