[bind10-dev] single vs multi module for libdns++ python binding

JINMEI Tatuya / 神明達哉 jinmei at isc.org
Wed Aug 25 22:18:34 UTC 2010


At Wed, 25 Aug 2010 21:04:49 +0200,
Shane Kerr <shane at isc.org> wrote:

> > For comparison, dnspython uses multiple (sub)modules for "message",
> > "name", "rrset", etc.  And, I felt it might be more convenient if we
> > want to define module specific functions (which are not class
> > methods).  It may also help separate the binding C++ source files per
> > functionality (= python "module").  On the other hand, if we want to
> > keep 1-to-1 relationship between C++ namespaces and python modules, I
> > see it makes sense to use the single, flat module (although I'm not
> > sure if there's a pragmatic benefit by having this relationship).
> > 
> > Is there any specific design decision on this point, or is this
> > something worth discussing?
> 
> While I think the reasons Jelte outlined are the most important, I'd
> like to throw in a point of personal preference.
> 
> For me, forcing the developer to figure out which modules are needed out
> of a set rather than providing a single one is somewhat annoying. For a
> late-binding language like Python, it can also be dangerous.

It's a mostly offtopic now, but for clarification, are you saying
you'd like to just say

import libdns_python

instead of

import libdns_python.message
import libdns_python.name
...
?

If so, you can make it possible even if we separate libdns_python.* as
separate modules.  In fact, with dnspython you only have to say
import dns
to use dns.message, dns.name, ... etc.

---
JINMEI, Tatuya



More information about the bind10-dev mailing list