3 ms·
Performance cost is a legitimate concern but one that should be considered in relative terms. e.g. yes there are more allocations, but in what context is the c
by g_delgado14 4y ago
Performance cost is a legitimate concern but one that should be considered in relative terms.
e.g. yes there are more allocations, but in what context is the code being used? Are we building gigabyte-scale real-time systems? no? ok then let's maybe not worry about performance right now and instead optimize for intuition, maintainability and readability. Obviously while at the same time monitoring CPU and memory consumption of our applications to help us determine when we might want to look to optimize our code.
- dahfizz 4y ago> then let's maybe not worry about performance right now and instead optimize for intuition, maintainability and readability. I would argue that throwing exceptions is the intuitive and readable thing for Python. Having to call isinstance for all possible return types of a function is not the "pythonic" way.