Greg Ewing wrote: > Nick Coghlan wrote: > >> Although the PEP may still want to mention how one would write *tests* >> for these things. Will the test drivers themselves need to be generators >> participating in some kind of trampoline setup? > > I don't see that tests are fundamentally different > from any other code that wants to call a value-returning > generator and get the value without becoming a generator > itself. So if it's to be mentioned in the PEP at all, > a general solution might as well be given (whether it's > to use a trampoline or just write the necessary next() > and except code). Agreed the problem is more general than just testing - but a test driver is potentially interesting in that you probably want the same test suite to be able to test both normal code and the cooperative multitasking code. Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia ---------------------------------------------------------------
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4