By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,814 Members | 1,050 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,814 IT Pros & Developers. It's quick & easy.

trigger exception in generator

P: n/a
I would like to trigger an
exception in a generator
upon return from "yield"

def mySimulationTask():
while 1:
# drive forward one simulation step
# do some stuff
except HitWall:
# handle this disaster ;-)

How can I possibly do this?
Maybe by hacking some internal
generator variables? ;-)


h i l l b r _at_
Jul 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.