@@ -44,6 +44,14 @@ def __getitem__(self, item):
4444 """
4545 return self .contains (item )
4646
47+ def __contains__ (self , item ):
48+ """
49+ Check if the item is in the filter. With a small probability, the filter
50+ may return true for an item not in the set (false positive). There is
51+ no false negative: if the filter returns false, the item is definitely not in the set.
52+ """
53+ return self .contains (item )
54+
4755 def __del__ (self ):
4856 lib .xor8_free (self .__filter )
4957
@@ -133,6 +141,14 @@ def __getitem__(self, item):
133141 """
134142 return self .contains (item )
135143
144+ def __contains__ (self , item ):
145+ """
146+ Check if the item is in the filter. With a small probability, the filter
147+ may return true for an item not in the set (false positive). There is
148+ no false negative: if the filter returns false, the item is definitely not in the set.
149+ """
150+ return self .contains (item )
151+
136152 def __del__ (self ):
137153 """
138154 Free the memory allocated for the Xor16 filter.
@@ -224,6 +240,14 @@ def __getitem__(self, item):
224240 """
225241 return self .contains (item )
226242
243+ def __contains__ (self , item ):
244+ """
245+ Check if the item is in the filter. With a small probability, the filter
246+ may return true for an item not in the set (false positive). There is
247+ no false negative: if the filter returns false, the item is definitely not in the set.
248+ """
249+ return self .contains (item )
250+
227251 def __del__ (self ):
228252 """
229253 Free the memory allocated for the Fuse8 filter.
@@ -315,6 +339,14 @@ def __getitem__(self, item):
315339 """
316340 return self .contains (item )
317341
342+ def __contains__ (self , item ):
343+ """
344+ Check if the item is in the filter. With a small probability, the filter
345+ may return true for an item not in the set (false positive). There is
346+ no false negative: if the filter returns false, the item is definitely not in the set.
347+ """
348+ return self .contains (item )
349+
318350 def __del__ (self ):
319351 """
320352 Free the memory allocated for the Fuse16 filter.
0 commit comments