BIND 10 #2908: Python wrapper for ZoneTableAccessor and getZoneTableAccessor
BIND 10 Development
do-not-reply at isc.org
Wed Jun 5 16:35:44 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
-------------------------------------+-------------------------------------
Comment (by jinmei):
Replying to [comment:8 vorner]:
> '''Interface'''
>
> I don't think the python interface needs the explicit methods, like
`is_last`. I believe the python iteration protocol is enough and these
methods would only confuse python programmers.
>
> Second, I know the ticket says so, but it seems to be that „zone table“
sounds already like the container holding zones, so it should be possible
to iterate directly over it, like:
>
> {{{#!python
> for zone in datasrc_clients.get_zone_table("sqlite3", True):
> # ...
> }}}
Right. The usage shown in the ticket description wasn't really
appropriate.
I guess we'd implement it through tp_iter and tp_iternext members of
`PyTypeObject` for the zone table (accessor). See
http://docs.python.org/3/c-api/typeobj.html
searching for "tp_iter".
--
Ticket URL: <http://bind10.isc.org/ticket/2908#comment:9>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list