Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def a():
- pass
- def comp():
- for f in (a,):
- if f is a:
- print("Identity")
- elif f == a:
- print("Equality")
- comp()
- class Test(object):
- def a(self):
- pass
- def comp(self):
- for f in (self.a,):
- if f is self.a:
- print("Identity")
- elif f == self.a:
- print("Equality")
- t = Test()
- t.comp()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement