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

Function try_receive_email

example_code/item_103.py:77–88  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

75 pass
76
77def try_receive_email():
78 # Returns an Email instance or raises NoEmailError
79 try:
80 email = next(EMAIL_IT)
81 except StopIteration:
82 email = None
83
84 if not email:
85 raise NoEmailError
86
87 print(f"Produced email: {email.message}")
88 return email
89
90
91print("Example 3")

Callers 1

produce_emailsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected