Implement Python Generators

This rather large patch which implement python generators.

Is there a case that either of these conditionals could be false?  It might be worth either explaining how it could happen, or making it into an assert if we think it shouldn't happen.