Here's a curiosity: after def my_hex(x): return hex(x)
one might expect hex and my_hex to be interchangeable in most situations. But (with both Python 2.x and 3.x) I get: >>> def my_hex(x): return hex(x) ... >>> class T(object): f = hex ... >>> class T2(object): f = my_hex ... >>> T().f(12345) '0x3039' >>> T2().f(12345) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: my_hex() takes exactly 1 argument (2 given) [36412 refs] Anyone know what the precise rules that lead to this behaviour are, or where they're documented? Surprised'ly yours, Mark -- http://mail.python.org/mailman/listinfo/python-list