M
Mark Dickinson
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:
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
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:
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