You wrote (call it FUTURE)
def foo(x: Protocol[id=int, name=str]): bar(x) baz(x)
As you know, at present this causes a SyntaxError.
However (call it NOW) def foo(x: Protocol[o(id=int, name=str])): bar(x) baz(x) has no syntax error.
I'll now state some goals.
1. Define 'o' and Protocol so that NOW gives the semantics you wish for. 2. Extend Python so that FUTURE give the semantics you wish for. 3. And the NOW syntax continues to work as expected (without changing 'o' and Protocol). 4. And all current use of container[key] continues to work as before.
I believe that it is possible to achieve these goals. My previous posts to this discussion outline some of the key ideas. My next step, when I have time, is to implement and publish general purpose code for the NOW part of this list of goals.
I hope this will help you and others.
with best regards