filters.iterator module

Contains base iteration functionality for the filter package.

class filters.iterator._IterObject(is_filters=None, not_filters=None)[source]

Bases: object

Base iterator class used to yield filtered items.

__init__(is_filters=None, not_filters=None)[source]

Store filters for the instance.

_is_valid(item)[source]

Return whether the given item is valid for the instances filters.

classmethod register_filter(filter_name, function)[source]

Register the given filter to the class.

classmethod unregister_filter(filter_name)[source]

Unregister the given filter from the class.

_filters = {}
iterator

Raise an error if the inheriting class does not have their own.

class filters.iterator._IterObjectMeta[source]

Bases: type

Meta class used to create a _filters dictionary for each class.

filters

Return the class filters dictionary.