by ppog · 9y ago · 0 comments
Our tools on the other hand are indeed 'so finely attuned and specialised to text' that other methods of representation have and will struggle to get traction...
SUPERTYPES = {'Real': ['Integer'],
'Complex': ['Real'],
'Integer': []}
def is_subtype(a, b):
if a == b:
return True
return any(is_subtype(x, b) for x in SUPERTYPES[a])
Which better expresses the intention of the code and is more flexible.