提交 62a64184 authored 作者: james@X40's avatar james@X40

added list extend function

上级 a346c910
......@@ -639,6 +639,10 @@ class ComponentList(Composite):
raise TypeError('ComponentList may only contain Components.', c, type(c))
self._components.append(c)
def extend(self, other):
for o in other:
self.append(o)
def __add__(self, other):
if isinstance(other, (list, tuple)):
return ComponentList(self._components + map(wrap,other))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论