Skip to content

Hashing fails for objects of local classes #5

@svetlin-mladenov

Description

@svetlin-mladenov
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions