objgenerator: Implement return with value and .close() method.

Return with value gets converted to StopIteration(value). Implementation
keeps optimizing against creating of possibly unneeded exception objects,
so there're considerable refactoring to implement these features.
This commit is contained in:
Paul Sokolovsky
2014-03-23 21:48:29 +02:00
parent 4b2b7ceca7
commit 962b1cd1b1
6 changed files with 144 additions and 13 deletions

1
py/objgenerator.h Normal file
View File

@@ -0,0 +1 @@
mp_obj_t mp_obj_gen_resume(mp_obj_t self_in, mp_obj_t send_val, mp_obj_t throw_val, mp_vm_return_kind_t *ret_kind);