Is there a reason not to do this?
Paul McGuire
ptmcg at austin.rr._bogus_.com
Thu Nov 30 23:19:43 EST 2006
"Carl Banks" <pavlovevidence at gmail.com> wrote in message
news:1164942311.945476.147100 at f1g2000cwa.googlegroups.com...
>
> A straightforward, Pythonic way to do it would be to create an
> intermediate representation that understands both the existing class
> interfaces and the RDB stuff, but that could lead to synchronizing
> problems and a big hit in performance. And it's probably a lot of work
> compared to tacking on methods. OTOH, it could help with hairiness you
> mention. (I recently did something similar in one of my projects,
> though the intermediary was transient.)
>
I would second Carl's recommendation that you find some way to persist an
interim version of these expensive-to-create objects, so you can quickly
load debuggable instances to accelerate your development process. With
luck, you can get by with out-of-the-box marshal/unmarshal using the pickle
module. We've done this several times in my office with objects that an
application creates only after some extensive GUI interaction - it just
slows down development too much without some quick import of debuggable
instances.
Even though this seems like a sidetrack, it's a pretty direct shortcut,
without too much unusual technology or design work.
-- Paul
More information about the Python-list
mailing list