Conditions | 2 |
Total Lines | 9 |
Code Lines | 7 |
Lines | 5 |
Ratio | 55.56 % |
Changes | 0 |
1 | from typing import Any |
||
13 | def __getitem__(cls, item: Any) -> Any: |
||
14 | # Take the item's class name into account to distinguish between |
||
15 | # e.g. ints and floats. |
||
16 | hashed = hash('{}{}{}'.format( |
||
17 | cls.__name__, item.__class__.__name__, item)) |
||
18 | if hashed not in cls._cache: |
||
19 | cls._cache[hashed] = SubscriptableType.__getitem__(cls, item) |
||
20 | result = cls._cache[hashed] |
||
21 | return result |
||
22 |