Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def equals(a, b):
- if isinstance(a, pony.orm.core.Entity):
- return type(a) == type(b) and a.get_pk() == b.get_pk()
- return a == b
- with db_session:
- a = Customer[1]
- with db_session:
- b = Customer[1]
- print(a is b, a == b, equals(a, b)) # False, False, True
Add Comment
Please, Sign In to add comment