On Friday 18 January 2002 11:04, Ian Bicking wrote:
> On Fri, 2002-01-18 at 13:58, Tavis Rudd wrote:
> > * the marginal speed benefits of direct access cannot be reaped
> > without dropping some important docstrings
>
> property() includes a docstring argument (the optional fourth
> argument). It's not as clearly visible, unfortunately, but it
> should still be extractable.
I didn't explain myself clearly enough:
Here's an example of 'quasi-properties', aka 'direct access', and no
docstrings:
class Transaction(object):
def __init__(self, app, ...):
self.application = app
Here it is again with true properties and a docstring:
class Transaction(object):
def __init__(self, app, ...):
self._application = app
def _getApp(self):
return self._application
application = property(_getApp, None, None, 'docstring')
This 'quasi-properties' approach is faster than the 'accessor-method'
approach that Webware currently uses. The true 'properties' style is
the equivalent to, or possibly slower than, accessor methods.
Tavis
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss