Paul Moore writes:
What you're missing, I think, is that we're talking about typing.Protocol - see here: https://docs.python.org/3/library/typing.html#typing.Protocol
I understand that we're talking about typing. What I don't understand is how any general facility provided in a standard library can be "defined close to the consumer". By definition, these facilities are far from the provider, since they're abstract (whether they're defined ABCs, "small" protocols, or duck typing). The point of my example is that indeed, my tiny "SJIS protocol" *arose* near the original consumer, but it was refined and is now *defined* "far" from any consumer. (The fact that it's self- providing is an accident of the fact that it's a concrete protocol.) I think that this is a useful process for software development (ie, design APIs from the point of view of the consumers and then make sure the backends provide them) but I don't see how this applies to structuring the Python stdlib or typing.*. Steve