23 Apr
2021
23 Apr
'21
9:49 a.m.
On Fri, 23 Apr 2021 at 10:31, Stephen J. Turnbull <turnbull.stephen.fw@u.tsukuba.ac.jp> wrote:
SJIS = 'shift_jisx0213'
*Now* that is a personal protocol, serving the same function of telling me "this code deals with a legacy Japanese encoding" and implementing it behind the scenes. But I don't see how that can be "defined close to its consumers", which are all over the place, including interactive sessions.
What am I missing, and how might that be applied to Python?
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 Paul