|
|
|
|
|
by tickettotranai
260 days ago
|
|
I mean, you can just... Not annotate something if creating the relevant type is a pain. Static analysis \= type hints, and even then... Besides, there must be some behavior you expect from this object. You could make a type that reflects this: IntIndexable or something, with an int index method and whatever else you need. This feels like an extremely weak argument. Just think of it as self-enforcing documentation that also benefits auto-complete; what's not to love? Having an IntIndexable type seems like a great idea in your use case. |
|