From 76e3428d8720aa25d86cd36532aa67e21287a252 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Fri, 2 Dec 2016 10:21:51 +0100 Subject: [PATCH] Comments: some minor clarifications Noticed accidental swap of `Ellipsis/...`, and note that `yield from` can be put back later on. Reviewers: dfelinto Reviewed By: dfelinto Differential Revision: https://developer.blender.org/D2390 --- blendfile/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/blendfile/__init__.py b/blendfile/__init__.py index e2635d0..20758d4 100644 --- a/blendfile/__init__.py +++ b/blendfile/__init__.py @@ -101,7 +101,7 @@ class BlendFile: "block_header_struct", # BlendFileBlock "blocks", - # [DNAStruct, Ellipsis] + # [DNAStruct, ...] "structs", # dict {b'StructName': sdna_index} # (where the index is an index into 'structs') @@ -448,12 +448,14 @@ class BlendFileBlock: else: struct = self.file.structs[struct_index] for f in struct.fields: + # Use "yield from" when Python2 is dropped for y in self.get_recursive_iter( f.dna_name.name_only, path_full, default, None, use_nil, use_str, 0): yield y def items_recursive_iter(self): for k in self.keys(): + # Use "yield from" when Python2 is dropped for y in self.get_recursive_iter(k, use_str=False): yield y