Skip to content
Snippets Groups Projects
Commit 360b650b authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Make python decoder iterable

parent ffbd9afa
Branches
Tags
No related merge requests found
......@@ -973,6 +973,13 @@ class Decoder(Codec):
self.reader.mark(value, decl)
return (value, decl)
def __iter__(self):
while True:
try:
yield self.decode()
except EOFError:
break
def create_object(self, name=None):
if isinstance(self, primitive):
result = None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment