I guess you could work around this by exploiting the slicing operator:

GenericClass[:(A, B)]

It makes sense to use the : in the context of typing, but I can see how this 
syntax can be confusing. The least confusing implementation I could think of is 
to limit the use of GenericClass[:_] to tuples, lists, sets and dicts (and 
future callable type signatures?), i.e.; it should only be used for structural 
type pattern matching.

Here is a simple demo: 
https://gist.github.com/jorenham/1c241a1cf33d2cc8235631b63fa8f279
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/JDBJGEPF2HVRJKZIWDU6CM5SW7ABDWZQ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to