1/15/2010

python craziness


class f:
def __init__( self, f ): self.f = f

class v:
def f( self ): return f( self )

print v()
print v().f()
print v().f().f

Output:

<__main__.v instance at 0x006B7120>
<__main__.f instance at 0x006B7148>
<__main__.v instance at 0x006B7148>

No comments:

Post a Comment