Reading PEP 340, it seems to me that blocks could be used for generating nested data structures: def blist(list): def enter(parent=None): if parent: parent.append(self) yield self x = blist() block x.enter() as x: x.append(1) block blist().enter(x) as x: x.append(2) x.append(3) print x this should print [1, [2], 3] For this to work, the scope of the block variable has to end with the end of the block. Currently the PEP leaves this unspecified. Bye, Walter Dörwald
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4