>>> class a(object):
... def __or__(self, t):
... return id(t)
... def __add__(self, t):
... return id(t)
...
>>> c = a()
>>> a()+c
13041552
>>> id(c)
13041552
__sub__ == -
>>> class a(object):
... def __or__(self, t):
... return id(t)
... def __add__(self, t):
... return id(t)
... def __sub__(self, t):
... return id(t)
...
>>> c = a()
>>> a()-c
13041552
>>> id(c)
13041552
>>> a()-c
13041552
>>> id(c)
13041552
why? will continue in next post.
No comments:
Post a Comment