News for hackers. Stuff that matters.
Re:Why Today's Python Developers Are Embracing Type Hints by tickettotranai on Sunday September 28, 2025 @07:43PM (#45409060)
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.

There are no comments on this comment yet.