context: tests: Don't compare .done() by "is"
This continues 2c8063f4 (*: Channels must be compared by ==, not by "is" even for nilchan) and changes comparision of .done() for different contexts from "is" to ==. The reason is that soon we are going to move contexts into C, and this way in context tree there potentially can be PyCtx -> CCtx -> PyCtx chains, and while all those contexts could have the same C-level channel, it would be difficult to propagate the knowledge that Python-level pychan wrapper should be also exactly the same. We already treat channel objects as pointers and require to compare them by ==, so there should be no loss here. However to keep performance of repeated select( ctx.done(), ... ) we continue to require that .done() for a particular python context object returns exactly the same channel object every time.
Showing
Please register or sign in to comment