Add note about iterators

This commit is contained in:
Luke Murphy 2019-08-07 08:07:45 +02:00
parent 021cdffbd1
commit 398000789c
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
1 changed files with 4 additions and 0 deletions

View File

@ -19,6 +19,10 @@ class FlatTreeIterator:
def __attrs_post_init__(self):
self.seek(self.index)
# TODO(decentral1se): Once we get to the point of actually using this
# module in hypercore or wherever it is needed we should consider whether
# or not to make this a real Python iterator using the protocol methods of
# __iter__ and __next__
def next(self) -> int:
"""The next index in the tree."""
self.offset += 1