I am trying the following example to learn the Generic typing in Python and can't figure out what is the default type for a Generic type.
What that example is trying to illustrate is that once the type checker knows that a
has type MyClass[int]
it does NOT accept calls to meth_1
or meth_2
with a str
.
This is in contrast with the example directly preceding it on the original page where it IS still possible (to call meth_2
with a str
).