File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
sdks/python/apache_beam/typehints Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1497,8 +1497,6 @@ def is_consistent_with(sub, base):
14971497 if sub == base :
14981498 # Common special case.
14991499 return True
1500- if isinstance (sub , AnyTypeConstraint ) or isinstance (base , AnyTypeConstraint ):
1501- return True
15021500 # Per PEP484, ints are considered floats and complexes and
15031501 # floats are considered complexes.
15041502 if sub is int and base in (float , complex ):
@@ -1507,7 +1505,9 @@ def is_consistent_with(sub, base):
15071505 return True
15081506 sub = normalize (sub , none_as_type = True )
15091507 base = normalize (base , none_as_type = True )
1510- if isinstance (sub , UnionConstraint ):
1508+ if isinstance (sub , AnyTypeConstraint ) or isinstance (base , AnyTypeConstraint ):
1509+ return True
1510+ elif isinstance (sub , UnionConstraint ):
15111511 return all (is_consistent_with (c , base ) for c in sub .union_types )
15121512 elif isinstance (base , TypeConstraint ):
15131513 return base ._consistent_with_check_ (sub )
You can’t perform that action at this time.
0 commit comments