Skip to content

Instantly share code, notes, and snippets.


VakarisZ/ Secret

Created Oct 22, 2019
What would you like to do?
Ring bug
from bson import ObjectId
import ring
oid1 = ObjectId('cafecafecafecafecafecafe')
oid2 = ObjectId('cafacafacafacafacafacafa')
oidx = ObjectId('cafecafecafecafecafecafe')
assert oid1 == oidx
assert oid1 is not oidx
assert oid1 != oid2
class Test:
def f(oid):
print('caching:', oid)
return oid
assert Test.f(oid1) is oid1
assert Test.f(oid2) is oid2
assert Test.f(oidx) is oid1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment