Python properties can not use acquisition?
Bug #143756 reported by
Christian Theune
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope 2 |
Won't Fix
|
Medium
|
Unassigned |
Bug Description
I was trying to use a property in Zope 2.9 lately in a Plone/CMF-related product. I was trying to access a portal tool via getToolByName in the property and found that 'self' was not acquisition-wrapped in the getter of the property.
To post a comment you must log in.
No, self is not wrap in a property.
But you can use instead:
from ComputedAttribute import ComputedAttribute te(barMethod, 1)
class Foo(object):
def barMethod(self):
pass
bar = ComputedAttribu
The 1 is important, it's a level of wrapping (see the ComputedAttribute code).
Why is this question in the bugtracker exactly? I should think that's what dev lists are for.