MCPcopy Create free account
hub / github.com/pybind/pybind11 / BareSetLike

Class BareSetLike

tests/test_stl.py:696–707  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

694
695 # Implements the Set protocol without explicitly inheriting from collections.abc.Set.
696 class BareSetLike:
697 def __init__(self, *args):
698 self.data = set(args)
699
700 def __len__(self):
701 return len(self.data)
702
703 def __contains__(self, item):
704 return item in self.data
705
706 def __iter__(self):
707 yield from self.data
708
709 # Implements the Set protocol by reusing BareSetLike's implementation.
710 # Additionally, inherits from collections.abc.Set.

Callers 1

test_set_caster_protocolFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_set_caster_protocolFunction · 0.68