On Sat, Jan 19, 2002 at 04:33:10PM -0800, Tavis Rudd wrote:
> On Saturday 19 January 2002 14:42, Mike Orr wrote:
> > It seems like we can adopt properties and __slots__ piecemeal.
> >
> > 1) Add a foo = property(foo, setFoo, None, None) call for each
> > property. Monitor performance to verify it doesn't go down.  If it
> > doesn't, we're no worse off than we were.
> 
> That won't work (or at least the example won't) because the property 
> 'foo' would mask the method 'foo'.

The property shouldn't care, it got the getter code object before the
name disappeared.  As for users, we can add a first step of:
        rename .foo() -> getFoo()
        foo = getFoo
so users won't have to change their servlets until the properties are
ready.

> >     Tavis, can you post the .field algorithm you were considering?
> 
> ??? I have no idea what you're referring to ;)

I mean, how you were going to transform foo/setFoo into properties:
what all the existing pieces would morph into.  If not the way I
described, then how?  

> > 2) Sometime later, migrate the docstrings into the properties.
> I believe the transition should proceed in one fell swoop if at all.  
> These docstrings a crucial part of the documentation.

True, but doing it piecemeal would help to control for errors at
each stage.  Also, how often do people actually use the docstring
objects anyway, rather than reading them in the source?  Anyway,
we can make quick-and-dirty docstrings thus:
        doc = "GET SYNTAX:\n%s\n---\nSET SYNTAX:\n%s" % \
                (getFoo.__doc__, setFoo.__doc)
        foo = property(getFoo, setFoo, none, doc)
for now and pretty it up later.

-- 
-Mike (Iron) Orr, [EMAIL PROTECTED]  (if mail problems: [EMAIL PROTECTED])
   http://iron.cx/     English * Esperanto * Russkiy * Deutsch * Espan~ol

_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to