File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -367,6 +367,7 @@ class Arrow(Type):
367367 def __init__ (self , type_in : Type , type_out : Type ):
368368 self .type_in = type_in
369369 self .type_out = type_out
370+ self .is_out_arrow = isinstance (self .type_out , Arrow )
370371 self .hash = hash ((self .type_in , self .type_out ))
371372
372373 def __pickle__ (o : Type ) -> Tuple :
@@ -414,15 +415,15 @@ def returns(self) -> Type:
414415 """
415416 Get the return type of this arrow.
416417 """
417- if isinstance ( self .type_out , Arrow ) :
418+ if self .is_out_arrow :
418419 return self .type_out .returns ()
419420 return self .type_out
420421
421422 def arguments (self ) -> TList [Type ]:
422423 """
423424 Get the list of arguments in the correct order of this arrow.
424425 """
425- if isinstance ( self .type_out , Arrow ) :
426+ if self .is_out_arrow :
426427 return [self .type_in ] + self .type_out .arguments ()
427428 return [self .type_in ]
428429
You can’t perform that action at this time.
0 commit comments