podhmo / metashape

0 stars 1 forks source link

changes to be able to call walker.walk(), multiple times. #115

Open podhmo opened 2 years ago

podhmo commented 2 years ago

e.g.

w = get_walker([A], recursive=True, aggressive=True)
metadata_resolver = w.resolver.metadata
resolver = w.resolver

list(w.walk())  # generator

# this is annoyed.
w = w.__class__(
    w._members, config=w.config.__class__(option=w.config.option), resolver=w.resolver
)  

list(w.walk())
podhmo commented 2 years ago
w = get_walker()
g = w.walk()
next(g)

list(w.walk())

print(list(g)) # ?

using Walker.append(), then the strategy returning cloned instance is not worked