Effectless but expensive. Or be careful with type hints in Python

  • Benchmarking is hard to do well. Benchmarking on modern machines is very hard (dynamic clocks, caching, more). Benchmarking on code that runs in less than a milisecond is very very hard. If you care about this performance you probably should not use Python. I'll take better checked, more readable Python over faster Python any day.

  • Python type hints are a step backwards in the evolution of programming languages. There, I said it.

    Before the pitchforks come out, I love types and I love dynamic languages too.

    But if I have to create a struct[struct[struct] for a type, and then import it with an obnoxious "if TYPE_CHECKING:" and then have to use an IDE that can do static analysis to even make sense of types, I might as well use a well-designed JVM language.

  • 900ns is not a millisecond?

  • undefined