From 5a0e10295937a9420ab192e2a99e4d4e7231feb4 Mon Sep 17 00:00:00 2001 From: Michael Chisholm Date: Mon, 15 Oct 2018 17:21:48 -0400 Subject: [PATCH] Modify docstring for apply_common_filters() to change what it says are the required types for its parameters. It gave specific types (list and set), when really it worked with more than just that (iterables). And I certainly didn't only call it with just lists and sets. --- stix2/datastore/filters.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/stix2/datastore/filters.py b/stix2/datastore/filters.py index 03585ad..0172a50 100644 --- a/stix2/datastore/filters.py +++ b/stix2/datastore/filters.py @@ -123,8 +123,11 @@ def apply_common_filters(stix_objs, query): Supports only STIX 2.0 common property properties. Args: - stix_objs (list): list of STIX objects to apply the query to - query (set): set of filters (combined form complete query) + stix_objs (iterable): iterable of STIX objects to apply the query to + query (non-iterator iterable): iterable of filters. Can't be an + iterator (e.g. generator iterators won't work), since this is + used in an inner loop of a nested loop. So we require the ability + to traverse the filters repeatedly. Yields: STIX objects that successfully evaluate against the query.