On Dec 8, 8:46 pm, Mark Dickinson <[EMAIL PROTECTED]> wrote:
> 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)
> ...
>
On Dec 8, 11:23 am, Peter Otten <[EMAIL PROTECTED]> wrote:
> I don't know if there is something official, I google for
>
> http://users.rcn.com/python/download/Descriptor.htm
>
> or "descrintro" every time I need a refresher.
Thank you! I'd read this before, but apparently I'd
either not taken it
Mark Dickinson wrote:
> 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
> ...
>>
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(12