Given a nested list of integers, implement an iterator to flatten it.
给定一个嵌套的整数列表,实现一个迭代器将其展开。
It is left open until the new nested list is completed, and then closed.
它是开放的,直到新的嵌套列表完成,然后闭合。
If you merge the other way, you construct a nested list (see Listing 24).
如果以其他方式执行合并,则会构造一个嵌套式列表(参见清单24)。
The sequence will contain a nested list of activities.
这个顺序活动包括一个嵌套的活动序列。
However, if the list is two-dimensional (that is, each element is itself a list), then you often want to 「unpack」 the contents of each nested list as it is iterated. You could do that like so.
不过,如果列表是二维的(即每个元素本身是一个列表),那么您通常想要在遍历时「解开」每个嵌套列表的内容。
Some of those will be basic (or atomic) activities and some will be complex activities, containing again a nested list of activities.
其中一些是基本(或原子)活动,而另一些是复杂活动。复杂活动又会包含一个嵌套的活动序列。