Implement EntityCollection.extend() method for Issue #27
Added extend() method to EntityCollection that accepts any iterable of Entity objects and adds them all to the collection. The method: - Accepts lists, tuples, generators, or any iterable - Validates all items are Entity objects - Sets the grid association for each added entity - Properly handles errors and empty iterables closes #27
This commit is contained in:
parent
923350137d
commit
1e7f5e9e7e
4 changed files with 165 additions and 1 deletions
|
|
@ -77,6 +77,7 @@ class UIEntityCollection {
|
|||
public:
|
||||
static PySequenceMethods sqmethods;
|
||||
static PyObject* append(PyUIEntityCollectionObject* self, PyObject* o);
|
||||
static PyObject* extend(PyUIEntityCollectionObject* self, PyObject* o);
|
||||
static PyObject* remove(PyUIEntityCollectionObject* self, PyObject* o);
|
||||
static PyMethodDef methods[];
|
||||
static PyObject* repr(PyUIEntityCollectionObject* self);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue