Y
Hacker News
new
|
ask
|
show
|
jobs
by
hchasestevens
2442 days ago
Your second use case is actually already covered in Python, assuming you have some kind of sentinel value you can break on:
for s in iter(network_service.read, ''): process(s)