25 Oct
2017
25 Oct
'17
6:22 p.m.
On Wed, Oct 25, 2017 at 5:30 PM, Steven D'Aprano
Maybe I'm just being slow today, but I don't see how you can write "generic code" to convert text to int/float/complex/Fraction, but not times. The only difference is that instead of calling the type directly, you call the appropriate classmethod.
What am I missing?
Nothing. The only annoyance is that the data processing code typically needs to know the type anyway, so the classmethod is one more variable to keep track of.