BIND 10 #2908: Python wrapper for ZoneTableAccessor and getZoneTableAccessor

BIND 10 Development do-not-reply at isc.org
Tue Jun 11 07:19:43 UTC 2013


#2908: Python wrapper for ZoneTableAccessor and getZoneTableAccessor
-------------------------------------+-------------------------------------
            Reporter:  jinmei        |                        Owner:
                Type:  task          |  pselkirk
            Priority:  medium        |                       Status:
           Component:  data source   |  reviewing
            Keywords:                |                    Milestone:
           Sensitive:  0             |  Sprint-20130611
         Sub-Project:  DNS           |                   Resolution:
Estimated Difficulty:  5             |                 CVSS Scoring:
         Total Hours:  0             |              Defect Severity:  N/A
                                     |  Feature Depending on Ticket:
                                     |  shared memory data source
                                     |          Add Hours to Ticket:  0
                                     |                    Internal?:  0
-------------------------------------+-------------------------------------
Changes (by vorner):

 * owner:  vorner => pselkirk


Comment:

 Hello

 Replying to [comment:14 pselkirk]:
 > > Also, the point with not needing get_iterator() was not addressed (or
 I didn't notice). Is it on purpose or did you overlook it? Also, if it's
 on purpose, can you share the reason for not agreeing on that?
 >
 > As I understand it, `get_zone_table_accessor()` will eventually provide
 methods to add and remove zones, but for now it only exists to get the
 iterator. It sounds like you want to merge `get_zone_table_accessor()` and
 `get_zone_table_iterator()` into one method like `get_zone_table()` which
 would hide the complexity of the C++ classes. I'm not sure how to answer
 that, because I'm not sure how these methods fit into the plan for the
 Python interface going forward.

 Well, that's not anything against usual python practices. The python list
 has `append` and `extend` and many more methods, but it still can be
 iterated.

 I don't propose for `get_zone_table_accessor()` to directly return the
 iterator. I believe there are two special python methods ‒ one that
 returns the next thing on iterator and one that returns the iterator
 itself. Currently, the iterator implements both (and returns itself as the
 iterator), which is OK and AFAIK part of some best practices for python as
 well. What I propose is instead of having explicit `get_iterator()`
 method, we implement the `tp_iter` in the accessor. That one will just
 return the newly created iterator.

 So I don't want to flatten the two classes into one. I just want to get
 the iterator without an explicit call.

-- 
Ticket URL: <http://bind10.isc.org/ticket/2908#comment:15>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list