Skip to content

Commit

Permalink
collections: use the overridable '._new' when creating a sub-collecti…
Browse files Browse the repository at this point in the history
…on via FilteredCollection
  • Loading branch information
koreno committed Oct 21, 2020
1 parent 296cd72 commit 46a3056
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions easypy/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,8 +644,8 @@ def __init__(self, base, preds, filters, parent=None, name=None):

def _new(self, items):
if hasattr(self.base, 'ID_ATTRIBUTE'):
return self.base.__class__(items, ID_ATTRIBUTE=self.base.ID_ATTRIBUTE)
return self.base.__class__(items)
return self.base._new(items, ID_ATTRIBUTE=self.base.ID_ATTRIBUTE)
return self.base._new(items)

def __repr__(self):
if self.name and self.base.name:
Expand Down

0 comments on commit 46a3056

Please sign in to comment.