MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / Sorter

Class Sorter

example_code/item_033.py:134–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132
133print("Example 9")
134class Sorter:
135 def __init__(self, group):
136 self.group = group
137 self.found = False
138
139 def __call__(self, x):
140 if x in self.group:
141 self.found = True
142 return (0, x)
143 return (1, x)
144
145
146print("Example 10")

Callers 1

item_033.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected