Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hashing fails for objects of local classes #5

Open
svetlin-mladenov opened this issue Apr 17, 2017 · 0 comments
Open

Hashing fails for objects of local classes #5

svetlin-mladenov opened this issue Apr 17, 2017 · 0 comments

Comments

@svetlin-mladenov
Copy link
Owner

def test_bound_method():
    class Test:
        def __init__(self):
            self.n = 0
        def inc(self):
            self.n += 1
        def get(self):
            return self.n
    obj = Test()
    fun = fcache(obj.get)
    assert fun() == 0

This code will fail despite the fact that Test is not being persisted on disk. Test is used just to compute the Hash of Test().get

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant