def is_compatible(self, typevar, its_type):
result = True<EOL>binding = self.binding_of(typevar)  <EOL>if binding is None:<EOL><INDENT>self.bind(typevar, its_type)  <EOL><DEDENT>elif issubclass(binding, its_type):<EOL><INDENT>self.bind(typevar, its_type)  <EOL><DEDENT>elif not issubclass(its_type, binding):  <EOL><INDENT>return False<EOL><DEDENT>binding = self.binding_of(typevar)  <EOL>if (typevar.__bound__ and<EOL>not issubclass(binding, typevar.__bound__)):<EOL><INDENT>return False  <EOL><DEDENT>if (len(typevar.__constraints__) > <NUM_LIT:0> and<EOL>not issubclass(binding, tg.Union[typevar.__constraints__])):<EOL><INDENT>return False  <EOL><DEDENT>return True<EOL>
Checks whether its_type conforms to typevar.
If the typevar is not yet bound, it will be bound to its_type.
The covariance/contravariance checking described in the respective section
of PEP484 applies to declared types, but here we have actual types;
therefore, (1) subtypes are always compatible, (2) we may have to
rebind the type variable to supertypes of the current binding several
times until the required most general binding is found.