MCPcopy Index your code
hub / github.com/bslatkin/effectivepython / NullSocket

Class NullSocket

example_code/item_099.py:67–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65
66print("Example 2")
67class NullSocket:
68 def __init__(self):
69 self.handle = open(os.devnull, "wb")
70
71 def send(self, data):
72 self.handle.write(data)
73
74socket = ... # socket connection to client
75video_data = ... # bytes containing data for video_id

Callers 1

item_099.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected