{"comment":{"created_at":"2011-10-24T14:34:01Z","body":"You're calling, and returning, `test` as an argument to `cached()`, so the first argument is `2`, not the callable `test`. There are a couple ways to fix that:\r\n\r\n```python\r\ndef test(x):\r\n    return x + 1\r\nprint cached(lambda: test(1), 'test', 60)\r\n\r\ndef outer(x):\r\n    def inner():\r\n        return x + 1\r\n    return inner\r\nprint cached(outer(1), 'test', 60)\r\n```\r\n\r\nThere are probably other solutions, too. Either way, you need to pass a callable as the first argument, not an int.","updated_at":"2011-10-24T14:34:01Z","url":"https://api.github.com/repos/jbalogh/django-cache-machine/issues/comments/2504128","id":2504128,"user":{"avatar_url":"https://secure.gravatar.com/avatar/8371744716a9335eb3dcae228fd9d996?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"8371744716a9335eb3dcae228fd9d996","url":"https://api.github.com/users/jsocol","id":180459,"login":"jsocol"}},"action":"created","issue":{"number":15,"created_at":"2011-09-29T08:11:48Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"I'm having issues with calling the manual cached function. \r\n\r\n    from caching.base import cached\r\n\r\n    def test(x):\r\n        return x+1\r\n    \r\n    print cached(test(1),'test',60)\r\n\r\nI then receive this error\r\n\r\n        262     if val is None:\r\n        263         log.debug('cache miss for %s' % key)\r\n    --> 264         val = function()\r\n        265         cache.set(key, val, duration)\r\n        266     else:\r\n\r\n    TypeError: 'int' object is not callable\r\n","comments":1,"title":"Manual cache method not working","updated_at":"2011-10-24T14:34:01Z","url":"https://api.github.com/repos/jbalogh/django-cache-machine/issues/15","id":1772743,"assignee":null,"milestone":null,"closed_at":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/fb89664a802ee41cf89ab7bed6392fcd?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"fb89664a802ee41cf89ab7bed6392fcd","url":"https://api.github.com/users/kevinpostal","id":157747,"login":"kevinpostal"},"html_url":"https://github.com/jbalogh/django-cache-machine/issues/15","labels":[],"state":"open"},"legacy":{"issue_id":1772743,"comment_id":2504128}}