|
|
|
|
|
by vikiomega9
2736 days ago
|
|
Noob question, I was not able to follow what the advantages of using session types were. What am I missing? Follow up,
1. How would session types differ from contract based testing?
2. Is there a notion of versioning on the types?
3. If there were better type support (ie. Well defined sum and product types) for wire protocols (protobufs etc) would that solve any of the problems session types might? |
|
we could also extend our coroutine to, after yielding the two intermediate values, accept a float (power) and yield `(a1 × b1) ^ power` as the result (this would let the user determine the exponent she wants based on the intermediate results, if she needed that for some reason). the type would then change to
we can approximate this as `Generator[Union[int, float], Union[None, float], None]` but that doesn't capture the order/number of the yields/sends.