Closed
Description
Currently, we have two functions is_subtype
and is_proper_subtype
. There are two corresponding visitors: SubtypeVisitor
and ProperSubtypeVisitor
, both of them implement some complex logic.
I think that ideally there should be only one visitor, ProperSubtypeVisitor
, and is_subtype
should be simply:
def is_subtype(left, right):
if isinstance(left, AnyType) or isinstance(right, AnyType):
return True
return is_proper_subtype(left, right)
Are there any reasons why it is not possible now? Maybe this question already exists in a roadmap mentioned in #3194 (btw @JukkaL @ddfisher is it possible to make it public?)
(I have found this issue #2038, but I am not sure it is up to date.)