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

Function take_unpacking_action

example_code/item_009.py:136–144  ·  view source on GitHub ↗
(light)

Source from the content-addressed store, hash-verified

134
135print("Example 8")
136def take_unpacking_action(light):
137 try:
138 (RED,) = (light,)
139 except TypeError:
140 # Did not match
141 pass
142 else:
143 # Matched
144 print(f"{RED=}, {light=}")
145
146
147take_unpacking_action(GREEN)

Callers 1

item_009.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected