This repository has no description
1from hydrox.typing import (
2 GenericMeta,
3 has_custom_init,
4)
5
6
7# NOTE: Can't cache this; booleans, floats, strings, and integers sometimes have the same hash values.
8def scoreinstance(left, right):
9 if anything(right):
10 return any_score
11 if hasattr(right, "__instancescore__"):
12 # return right.__instancescore__(left)
13 if isinstance(right, GenericMeta):
14 if has_custom_init(right):
15 return type(right).__instancescore__(right, left)
16 return right.__instancescore__(left)
17 return scoresubclass(get_type(left), right)