79373446

Date: 2025-01-21 07:02:16
Score: 0.5
Natty:
Report link

Both the main function (offer) and the new function (process_interrupt) are python generators. So in fact you want to divide a generator into two generators. There is a special syntax for delegating to a subgenerator (PEP 380):

yield from <expr>

When

action = process_interrupt(action, simpy_car, simpy_tankcar)

is replaced by

action = yield from process_interrupt(action, simpy_car, simpy_tankcar) 

everything works fine.

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Frank Tap