[pypy-dev] gdbm

Dan Stromberg drsalists at gmail.com
Wed Nov 17 00:24:58 CET 2010

On Tue, Nov 16, 2010 at 8:38 AM, <exarkun at twistedmatrix.com> wrote:

> On 04:27 pm, drsalists at gmail.com wrote:
> >On Tue, Nov 16, 2010 at 4:17 AM, Antonio Cuni <anto.cuni at gmail.com>
> >wrote:
> >>Sounds fine, do you feel like implementing it? :-)
> >>
> >>Moreover, I also agree with amaury that your code is very similar to
> >>the
> >>one in the current dbm.py, so we should maybe try to refactor things
> >>to
> >>share common parts between the twos.
> >I'd be happy to.
> >
> >Would sharing based on inheritance or a more functional approach be
> >preferred?
> No, avoid inheritance where possible.  Composition is preferred.
Due to performance?  Or "flat is better than nested" - as more of a
philosophical issue?  I'm not arguing for inheritance, just wanting to
understand the reasoning behind it.

> As for "functional", I don't really know what approach you're describing
> with that word.
I mean something like what you'd do in Lisp, ML or Haskell (not that I know
any of those that well).  I suppose in this case it would mean
functools.partial() as a decorator, or perhaps a wrapper around
functools.partial() used as a decorator.

Then again, maybe functools.partial() imposes its own performance penalty?
That's part of why I'm wondering if avoiding inheritance is a
performance-related goal.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20101116/75bf0635/attachment.html>

More information about the Pypy-dev mailing list