@eliocamp Interesting! I got a *slightly* more helpful error message:
TypeError: Random.randint() takes 3 positional arguments but 4 were given
Subtly, random.randint calls Random.randint. Presumably it passes along an extra implicit argument (self), but never bothers to count its own arguments.
I'd love to hear a longer explanation from Pythonistas who know more about this.
@peterdrake @eliocamp your assumptions are correct. The called method expects (self, a, b); in the given example it gets (self, a, b, c). Hence the technically correct error message, however misleading it is for the programmer. Happens unfortunately (and reliably) every time you call an instance method with wrong number of arguments.