Documentation
*Notes:
For T and A, what type is accepted is clearly explained in the example of typing.TypeVar while for S isn't explained clearly even though str itself is also accepted as shown below:
T = TypeVar('T') # Can be anything
S = TypeVar('S', bound=str) # Can be any subtype of str <- Here
A = TypeVar('A', str, bytes) # Must be exactly str or bytes
So, S should be explained more clearly as shown below:
S = TypeVar('S', bound=str) # Can be str or any subtype of str
Linked PRs