Tweak FilterSet docstrings style
parent
a1befe6387
commit
194672ee2b
|
@ -193,7 +193,7 @@ class FilterSet(object):
|
||||||
that Filters that had a dict as a value could not be added to a Python
|
that Filters that had a dict as a value could not be added to a Python
|
||||||
set as dicts are not hashable. Thus this class provides set functionality
|
set as dicts are not hashable. Thus this class provides set functionality
|
||||||
but internally stores filters in a list.
|
but internally stores filters in a list.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, filters=None):
|
def __init__(self, filters=None):
|
||||||
"""
|
"""
|
||||||
|
@ -205,16 +205,16 @@ class FilterSet(object):
|
||||||
self.add(filters)
|
self.add(filters)
|
||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
"""provide iteration functionality of FilterSet"""
|
"""Provide iteration functionality of FilterSet."""
|
||||||
for f in self._filters:
|
for f in self._filters:
|
||||||
yield f
|
yield f
|
||||||
|
|
||||||
def __len__(self):
|
def __len__(self):
|
||||||
"""provide built-in len() utility of FilterSet"""
|
"""Provide built-in len() utility of FilterSet."""
|
||||||
return len(self._filters)
|
return len(self._filters)
|
||||||
|
|
||||||
def add(self, filters=None):
|
def add(self, filters=None):
|
||||||
"""add a Filter, FilterSet, or list of Filters to the FilterSet
|
"""Add a Filter, FilterSet, or list of Filters to the FilterSet.
|
||||||
|
|
||||||
Operates like set, only adding unique stix2.Filters to the FilterSet
|
Operates like set, only adding unique stix2.Filters to the FilterSet
|
||||||
|
|
||||||
|
@ -238,7 +238,7 @@ class FilterSet(object):
|
||||||
self._filters.append(f)
|
self._filters.append(f)
|
||||||
|
|
||||||
def remove(self, filters=None):
|
def remove(self, filters=None):
|
||||||
"""remove a Filter, list of Filters, or FilterSet from the FilterSet
|
"""Remove a Filter, list of Filters, or FilterSet from the FilterSet.
|
||||||
|
|
||||||
NOTE: method designed to be very accomodating (i.e. even accepting filters=None)
|
NOTE: method designed to be very accomodating (i.e. even accepting filters=None)
|
||||||
as it allows for blind calls (very useful in DataStore)
|
as it allows for blind calls (very useful in DataStore)
|
||||||
|
|
Loading…
Reference in New Issue