Init collection from a list of instances.
(self, instances:list=None, parent=None)
| 12 | class BaseCollection: |
| 13 | '''Base collection representing a list of instances.''' |
| 14 | def __init__(self, instances:list=None, parent=None): |
| 15 | '''Init collection from a list of instances.''' |
| 16 | self._parent = parent |
| 17 | self._instances = [] |
| 18 | self.extend(instances or []) # Note to exclude empty instance by default |
| 19 | |
| 20 | def __getitem__(self, idx): |
| 21 | try: |