Tom Ritchford
Nov 7, 2023

--

Interestingly, every NewType I ever created got turned into an actual class fairly fast because we always wanted to hang extra functionality on it.

Python 3 and I think 2 (I can’t run 2.7 on this machine it seems!) allow you to write instead:

class CarID(int):
pass

so I just do that sort of thing now with the expectation that more methods will eventually follow.

--

--

No responses yet